Copy link to clipboard
Copied
Revisiting an old animation that I created many years ago with Flash & AS2.
I have several movieclips linked to the main parent timeline with a stop() action on each frame.
On each movieclip child timeline I have an action layer with a keyframe on the last frame to go to the next movieclip.
for example: _root.gotoAndStop(2)
How can I get this to work in Animate CC 2018 using AS3?
I tried this on the last frame of the first movie clip :
MovieClip(root).mc_1.gotoAndStop(2);
then
MovieClip(root).mc_2.gotoAndStop(3);
etc etc but
I have just started using Animate CC and not familiar with AS3 at all.
The animation is output to HTML5 Canvas.
MovieClip(root).gotoAndStop(2) would be the direct conversion of your example as2 to as3.
Copy link to clipboard
Copied
MovieClip(root).gotoAndStop(2) would be the direct conversion of your example as2 to as3.
Copy link to clipboard
Copied
how is this cod in html5?
Copy link to clipboard
Copied
var total = 2; //DOM
HOW DO I GET INTO A MOVIECLIP?
this.parent.texto.text = this.parent.total;
Why isn't it working?
Copy link to clipboard
Copied
first, if you use "var" to declare a variable in canvas, that variable is only defined in the frame where the declaration was made. ie, in the next frame total is undefined.
so you probably want to use this.total = 2;
then this.total is defined after this line of code executes no matter what frame is currently played.
next, if you want to retrieve this.total from a child movieclip, you must wait until that line of code in the parent executes. i'm not sure you are, but if you are this would work:
this.parent.texto.text = this.parent.total;
Copy link to clipboard
Copied
and how to get index array?
var answer = [1,2]; // this DOM
this.parent.texto.text = this.parent.answer [1]; // ANSWER 2
Copy link to clipboard
Copied
again, "answer" is only defined when the playhead is in the frame where "answer" is defined and the code you showed would work (as long as the playhead is on that frame).
Copy link to clipboard
Copied
Thank you!
Copy link to clipboard
Copied
you're welcome.