Hi check this out,
for (i = 0; i < total; i++)
{
...
duplicateMovieClip(clip_to_copy, "clipid" + i,
i);
var word_mc:MovieClip = eval("clipid" + i);
trace("word_mc = " + word_mc);
trace("eval() = " + eval("clipid" + i));
...
}
Any ideas what I am doing wrong here.
I duplicate a clip and use eval to get a reference back to it, ie
word_mc below
But as you can see from the output, word_mc is always null
BUT if I change the line 'var word_mc:MovieClip' to just 'var word_mc',
ie remove the type definition
It works, so why if I define the type definition for my variable does
the assignment break?
Cheers alan.
Output...
word_mc =
eval() = _level0.clipid1
word_mc =
eval() = _level0.clipid2
word_mc =
eval() = _level0.clipid3
word_mc =
eval() = _level0.clipid4
--
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.
If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.
Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of DA Group.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com