Copy link to clipboard
Copied
Hi there!
I have tried to simplify my bigger question in the following example.
(Also you may download this FLA if needed)
what do I have:
- an EMPTY scene.
- 2 movieclips in library (m1mc , m2mc)
I use addChild method to add them to stage (m1=m1mc , m2=m2mc). this is the code in Frame 1 of empty scene:
var m1:m1mc = new m1mc();
var m2:m2mc = new m2mc();
addChild(m1);
addChild(m2);
m1.x = 100;
m2.x = 300;
"m1mc" contains some frames that in frame 1 I have asked it to stop:
stop();
And finally my questions is:
HOW to write a code in frame 1 of "m2mc" (that is in library) to tell "m1mc" gotoAndStop frame 2 (in this example)??
I CAN access and change the alpha of "m1mc" from the timeline of "m2mc" with this code:
parent.getChildAt(0).alpha = 0.5; //works fine
but I CAN'T use the same method to tell "m1mc" gotoAndStop(someFrame)
parent.getChildAt(0).gotoAndStop(2);
//Error Symbol 'm2mc', Layer 'Layer 2', Frame 1, Line 2 1119: Access of possibly undefined property gotoAndStop through a reference with static type flash.display:DisplayObject.
Any help would be highly appreciated
that code is poor but you could use:
MovieClip(parent.getChildAt(0)).gotoAndStop(2);
Copy link to clipboard
Copied
that code is poor but you could use:
MovieClip(parent.getChildAt(0)).gotoAndStop(2);
Copy link to clipboard
Copied
WOW kglad, the whole night I was searching for this formula you just offered!! WELLDONE man!!
Wish you all the best and take care
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now