• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Several movieclips on main timeline

Community Beginner ,
Aug 19, 2018 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.

Views

519

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
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 19, 2018 Aug 19, 2018

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

Votes

Translate

Translate
Community Expert ,
Aug 19, 2018 Aug 19, 2018

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Aug 25, 2020 Aug 25, 2020

Copy link to clipboard

Copied

how is this cod in html5?

Votes

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
community guidelines
Community Beginner ,
Aug 26, 2020 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?

Votes

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
community guidelines
Community Expert ,
Aug 26, 2020 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;

Votes

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
community guidelines
Community Beginner ,
Aug 26, 2020 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

Votes

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
community guidelines
Community Expert ,
Aug 27, 2020 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).

Votes

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
community guidelines
Community Beginner ,
Aug 27, 2020 Aug 27, 2020

Copy link to clipboard

Copied

Thank you!

Votes

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
community guidelines
Community Expert ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

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
community guidelines