Copy link to clipboard
Copied
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......
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
...Copy link to clipboard
Copied
The code is still same in AS3:
gotoAndPlay(frameNumber);
Copy link to clipboard
Copied
thanks a lot....hmm but do I not need anything more?
this.gotoAndPlay(frameNumber); in a frame do not work
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Thanks you both of you - it helped a lot. I works now and I have moved on.
Have a nice weekend
Copy link to clipboard
Copied
You'r Welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now