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

Function or var for: gotoAndPlay("1")

Community Beginner ,
Jul 08, 2011 Jul 08, 2011

Hi

In AC2 there is a function for gotoAndPlay("1"). Please help me with an equivalent for that in AC3.ne with

I have a main timeline with 4 animations. When one of the animations is finished I want the playhead to jump to the start frame of this animations and start playing again automatically. I would rather not put the animation in a seperate movieClip. And it is not activated by the mouse.......

How will the code look like - the only examples I can find is with an Event handled by a Click......

TOPICS
ActionScript
1.3K
Translate
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

Mentor , Jul 08, 2011 Jul 08, 2011

this or MovieClip(root) has to use depends on where you'r calling the gotoAndPlay, if you'r on the mainTimeline then just use

Targeting a frame number:

gotoAndPlay(20); (or) gotoAndStop(20);

Targeting a frame label

gotoAndPlay("label") (or) gotoAndStop("label");

Targeting a frame number on scenes:

gotoAndPlay(1,"scene 2");

When targeting from within movieclip to play the top level timeline:

MovieClip(root).gotoAndPlay(20); (or) MovieClip(parent).gotoAndPlay(20);

To Target some movieclip:

mc.gotoAndPlay(20

...
Translate
Mentor ,
Jul 08, 2011 Jul 08, 2011

The code is still same in AS3:

gotoAndPlay(frameNumber);

Translate
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 ,
Jul 08, 2011 Jul 08, 2011

thanks a lot....hmm but do I not need anything more?

this.gotoAndPlay(frameNumber); in a frame do not work

Translate
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
LEGEND ,
Jul 08, 2011 Jul 08, 2011

You do not need to use "this", and you do not use quotations when you specify a frame number (or use a variable).  You only use quotations when you specify a frame label.

Translate
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
Mentor ,
Jul 08, 2011 Jul 08, 2011

this or MovieClip(root) has to use depends on where you'r calling the gotoAndPlay, if you'r on the mainTimeline then just use

Targeting a frame number:

gotoAndPlay(20); (or) gotoAndStop(20);

Targeting a frame label

gotoAndPlay("label") (or) gotoAndStop("label");

Targeting a frame number on scenes:

gotoAndPlay(1,"scene 2");

When targeting from within movieclip to play the top level timeline:

MovieClip(root).gotoAndPlay(20); (or) MovieClip(parent).gotoAndPlay(20);

To Target some movieclip:

mc.gotoAndPlay(20);

Hope it helps!

Translate
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 ,
Jul 08, 2011 Jul 08, 2011

Thanks you both of you - it helped a lot. I works now and I have moved on.

Have a nice weekend

Translate
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
Mentor ,
Jul 08, 2011 Jul 08, 2011
LATEST

You'r Welcome

Translate
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