A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: gotoAndPlay() not working in main timeline...

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    2

    gotoAndPlay() not working in main timeline...

    sorry if it seems like this has been gone over before, but I really can't find an answer.

    I have a main timline with MCs in it. when the MC gets to the last frame, there's an onEnterFrame event telling the main timline to go back to frame 129 (labled "b1") and play.

    I got the MovieClip(root).gotoAndPlay("b1"); part added to my function to call the root. however, when I test the movie, it does everything correct except play. it goes to b1 and stops. here's my as3:

    code:
    this.addEventListener(Event.ENTER_FRAME,goBack);
    function goBack(e:Event):void {
    MovieClip(root).gotoAndPlay("b1");
    }



    any ideas why it won't play? I've tried using just the frame number and that won't help either. there's nothing else on the main timeline to stop the movie...

    J.

  2. #2
    Junior Member
    Join Date
    Aug 2009
    Posts
    7
    I'm fairly new but I think
    PHP Code:
    _root.goToAndPlay("b1"); 
    might work.

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    6
    try:

    this.gotoAndPlay(129);

  4. #4
    Junior Member
    Join Date
    Aug 2009
    Posts
    2
    well, _root is from as2 and doesn't work in as3. and using .this, wouldn't that just be referencing the MC that is inside the main timeline? I need it to go out from the MC I'm currently in, and move the main timeline back...

    J.

  5. #5
    Junior Member
    Join Date
    Aug 2009
    Posts
    6
    If you are trying to run again your MC , you have to tell him to play again when you enter frame 129:

    yourMC.play();

    probably you have stop() at the end of your MC, that is way it can't run again.

    by calling gotoandPlay you tell the frame to play not your MC.

    add yourMC.play(); at the begining of frame 129 .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center