natalia Vikhtinskaya wrote:
Hi to all
On main timeline I have
var countN:int=0; // this numberl be changed later
var clip_mc = new clip_mc(); // this clip is placed in library
addChild(clip_mc);
How can I read countN inside clip_mc?
Wait for the clip to be ADDED. The use the parent or root property to
get a reference to the main timeline. Do note that the type will be
DisplayObjectContainer, not something with your custom stuff, so you
will have to cast it to your correct type. Here, the MainTimeline.
Variables defined in framescripts are converted to properties of the
class for the timeline. In this case, properties of the document class.
So do this:
With the scope of clip_mc (say, the constructor or framescript in first
frame):
addEventListener(Event.ADDED,added);
function added(e:Event) {
var countN:int=MainTimeline(root).countN;
}
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders