Skip to main content
Participant
March 22, 2011
Answered

Buttons taking me to the wrong scenes! Help!

  • March 22, 2011
  • 1 reply
  • 805 views

Okay, so I've got a website I've been working on. I've finally figured out how to get the buttons to work, BUT, now, they're taking me to the wrong scene.

like, say, it should take me to Scene 4, it takes me to Scene 2.  What's going on and how can I fix it?

This topic has been closed for replies.
Correct answer Ned Murphy

How would I use and save files as Movie Clips?


You don't.  You save what you are creating as a scene as a movieclip.  To do that you just copy the timeline of the scene into the timeline of an empty movieclip.  Then you can place that movieclip into the one main timeline, assign a label for the frame, and you don't have to deal with targeting scenes in your button code. But you still need to assign your event listeners to the buttons.

1 reply

Ned Murphy
Legend
March 22, 2011

Show the code that is not working.

DaemonDGAuthor
Participant
March 22, 2011

There are several. They work, but take you to the wrong scene. Could it be that they are the same buttons on 4 different scenes, minus function names?

Here is one of them.

stop();

addEventListener(MouseEvent.MOUSE_DOWN, myBtnasdfasdfasdfHandsler);

function myBtnasdfasdfasdfHandsler(event:MouseEvent):void {

    gotoAndStop(1, "Scene 4");

}

Now, this code WILL take me to another scene, no doubt. But it usually takes me to the wrong one.

DaemonDGAuthor
Participant
March 22, 2011

You don't.  You save what you are creating as a scene as a movieclip.  To do that you just copy the timeline of the scene into the timeline of an empty movieclip.  Then you can place that movieclip into the one main timeline, assign a label for the frame, and you don't have to deal with targeting scenes in your button code. But you still need to assign your event listeners to the buttons.


Sorry for the repeat Noob questions, but could you explain that last part a bit more? Would I make 2 scenes? Or what? And, how would I copy the entire timeline and paste it into it.