[Xerte] Learning Object Properties

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Mar 24 11:49:04 GMT 2009


In your page:

 

Add a script icon:

 

cp = myPage.addColourPicker(20,20); //myPage is the id of the page icon
- but could be any icon;

 

add an interaction icon, add an event response, the icon is cp, the
event name is colourChange //note cp is the icon, the colourpicker
itself, not the icon it is added to;

 

Add script to the response:

 

rootIcon.beginFill(cp.colour,100);

rootIcon.drawRect(0,0,800,600); //or whatever you want;

 

J

 

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of
steve.frank at lucite.com
Sent: Tuesday, March 24, 2009 11:41 AM
To: Xerte discussion list
Subject: RE: [Xerte] Learning Object Properties

 


Now that I know how to change the background colour using script, I now
want to allow the user to choose the colour using a colour picker. 

I've added a colour picker to my entry page (mainPage.addColourPicker),
added a 'selectColour' interaction to the same page and to this I've
added an event that listens for the colourChange event to be broadcast
by the mainPage icon. The script attached to this event should then set
the fill colour  (rootIcon.beginFill(mainPage.colourPicker.colour,100))
before drawing the background rectangle. 

Two problems:- 

Firstly the colourChange event does not appear to be being broadcast by
mainPage - or if it is, my event is not picking it up. How should this
intyeraction be setup? 

Secondly, I don't appear to have the correct syntax for getting the new
colour from the colour picker - how do I do this? 

Any help appreciated! 

Steve
________________________________________________________________________
__________
Lucite International Group Limited. Registered in England No. 5671799. 
Registered Office: Queens Gate, 15-17 Queens Terrace, Southampton SO14
3BP, United Kingdom
Holding Company for the Lucite International Group
 

IMPORTANT NOTICE::- This email is confidential, may be legally
privileged, and is solely for the use of the intended recipient. Access,
disclosure, copying, distribution, or reliance on any of it by anyone
else is prohibited and may be a criminal offence. 
If you have received this e-mail by mistake, please notify the sender
immediately by e-mail and delete this e-mail from your system. The
sender has taken reasonable precautions to ensure no viruses are present
in this e-mail however the company cannot accept 
responsibility for any loss or damage arising from the use of this
e-mail or attachments. Please note that this e-mail has been created in
the knowledge that Internet e-mail is not a 100% secure communications
medium. 
We advise that you understand and consider this lack of security when
e-mailing us.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090324/f5aff2bb/attachment.html


More information about the Xerte mailing list