Highlighted

Several movieclips on main timeline

Community Beginner ,
Aug 19, 2018

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.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

MovieClip(root).gotoAndStop(2) would be the direct conversion of your example as2 to as3.

Views

202

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Several movieclips on main timeline

Community Beginner ,
Aug 19, 2018

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.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

MovieClip(root).gotoAndStop(2) would be the direct conversion of your example as2 to as3.

Views

203

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 19, 2018 0
Adobe Community Professional ,
Aug 19, 2018

Copy link to clipboard

Copied

MovieClip(root).gotoAndStop(2) would be the direct conversion of your example as2 to as3.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2018 1
Community Beginner ,
Aug 25, 2020

Copy link to clipboard

Copied

how is this cod in html5?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 25, 2020 0
Community Beginner ,
Aug 26, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

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;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Community Beginner ,
Aug 26, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 27, 2020

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
Community Beginner ,
Aug 27, 2020

Copy link to clipboard

Copied

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
kglad LATEST
Adobe Community Professional ,
Aug 28, 2020

Copy link to clipboard

Copied

you're welcome.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 28, 2020 0