Copy link to clipboard
Copied
Well I am baffled. I have on my stage 1 a movie clip (mc1) with 3 buttons in it. I have no errors and the first button goes to the correct frame on stage 1 no problem. the other 2 keep going to the wrong frame. I have tried going to frame numbers, renaming my button instances and tried going to frame labels and the other 2 buttons no matter what I have tried go to the wrong frame. Any Ideas?
one person said its a flash glitch and im screwed. hoping to get a second opinion.
Again the buttons below are inside a movie clip named "mc1" and the buttons go to a frame on my main stage "Stage1"
Thanks in advance.
| My code for reference |
|---|
stop() import flash.events.MouseEvent; door1.addEventListener(MouseEvent.CLICK, on_click) function on_click(e: MouseEvent) { MovieClip(root).gotoAndStop(41) } import flash.events.MouseEvent; beddoor.addEventListener(MouseEvent.MOUSE_DOWN, on_click) function on_click2(e: MouseEvent) { MovieClip(root).gotoAndPlay("scene1_frame42"); // and label that frame } import flash.events.MouseEvent; door3.addEventListener(MouseEvent.CLICK, on_click) function on_click3(e: MouseEvent) { MovieClip(root).gotoAndPlay("bedroom"); } |
Your event listeners all call the same function... "on_click". That is why you only go to one frame. Try calling the other two functions for the other two buttons.
Copy link to clipboard
Copied
Your event listeners all call the same function... "on_click". That is why you only go to one frame. Try calling the other two functions for the other two buttons.
Copy link to clipboard
Copied
You do not need to import more than once. If you are coding in the Flash timeline you do not need to import at all for most of the commonly used classes, such as the MouseEvent class.
Copy link to clipboard
Copied
Thanks I didn't even realize I did that. All is working great thank you!
Copy link to clipboard
Copied
You're welcome
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more