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

Triggering a simple action with an enter_frame event

Community Beginner ,
Sep 09, 2009 Sep 09, 2009

I'm struggling to move from AS2 to AS3 and trying to mimic an old AS2 trick. When the playhead hits a frame on my mc's timeline with this code:

_root.gotoAndPlay("3");

the main/root/parent timeline would go to frame 3. Clean, short, simple. How can I do this in AS3?

I've tried this code but it didn't work:

this.addEventListener(Event.ENTER_FRAME, proceedNow);

function proceedNow(event:Event){

     //parent.nextFrame();

     parent.gotoAndPlay("3");

}

I must be going about this the wrong way…

TOPICS
ActionScript
556
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 Expert ,
Sep 09, 2009 Sep 09, 2009
LATEST

MovieClip(root).gotoAndPlay(3);  // p.s. in as2 and as3 you should not start a frame label with a number.

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