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.

Ned Murphy
Legend
March 22, 2011

Nvm. I figured it out


Cool... just to be clear... one scene.  And you don't have to create scenes and then convert them to movielcips... you can build the movieclip up from the start instead.  And the other option in avoiding scenes is to just spread stuff out along the one scene's timeline.  When you use movieclips you can sit in frame 1 for the whole file and just control visibility, but you also have the option to spread stuff out along the timeline and travel to it instead... and you can mix the two approaches as well if it's convenient for your design.