[Xerte] icon property

Julian Tenney Julian.Tenney at nottingham.ac.uk
Thu Oct 2 12:15:17 BST 2008


If you want the actual movieclips to have particular properties, you can
use the initObject property - it uses a shorthand object like this:
{name: "jules", age:"21", likes: "banjos"}

 

Then the movieclip will have properties .name, .age, and .likes

 

Rather than use myIconID.XMLElement.attributes.propertyName, which is a
real mouthful, use myIconID.getProperty('propName'); to return the
values from the attributes of the XLElement.

 

XMLElement was intended as an internal property only.

 

HTH,

 

J

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Elly Langewis
Sent: 02 October 2008 12:08
To: Xerte discussion list
Subject: Re: [Xerte] icon property

 

Thanks! That helps. XMLElement will be valuable to me the way I am
trying to organize my course (of course I've been programming
exclusively in Authorware for much too long).


 

On Thu, Oct 2, 2008 at 12:50 PM, Julian Tenney
<Julian.Tenney at nottingham.ac.uk> wrote:

When you set the property of an icon using the editor, what you are
doing is setting the value of an attribute in the underlying XML file,
like this:

 

<DIS name="The Name For My Icon" id="myGraphic" x="etc"..../>

 

That xml node is used to initiate a MovieClip at runtime. That movieclip
can be addressed using the id defined in the xml (if it was defined -
otherwise it gets a computer generated name);

 

The values of the attributes in the XML are not necessarily translated
into properties of the resulting movieclip. As you have found, name will
return undefined.

 

Each icon is a movieclip. Each Icon movieclip has a property called
XMLELement. This is the XML node that was used to initiate the icon.

 

So myIcon.XMLElement.attributes.name
<http://myicon.xmlelement.attributes.name/>  will contain the value you
entered in the editor.

 

Hope that helps understand what's going on.

 

J

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Elly Langewis
Sent: 02 October 2008 11:09
To: Xerte at lists.nottingham.ac.uk
Subject: [Xerte] icon property

 

Hi Julian,

 

In the Help file it says:

 

For an icon with an id of 'myIcon', you can address properties and
methods using the following code: 

 

myIcon.property = value;

myIcon.methodName();

 

But myIcon.name does return 'undefined' (for a page).

I get the value of the property 'name' back with myIcon.title...so my
problem is solved, but I do not see why.

Even if I add the property 'title' to the page myIcon.name stays
'undefined', so it is not a mix-up.

Elly


_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte




-- 
Elly Langewis
courseware developer
Department of Biology
Utrecht University

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


More information about the Xerte mailing list