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

Flash buttons going to wrong frame

New Here ,
Nov 08, 2015 Nov 08, 2015

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");

}

TOPICS
ActionScript
522
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

correct answers 1 Correct answer

LEGEND , Nov 08, 2015 Nov 08, 2015

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.

Translate
LEGEND ,
Nov 08, 2015 Nov 08, 2015

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.

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
LEGEND ,
Nov 08, 2015 Nov 08, 2015

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.

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
New Here ,
Nov 08, 2015 Nov 08, 2015

Thanks I didn't even realize I did that. All is working great thank you!

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
LEGEND ,
Nov 09, 2015 Nov 09, 2015
LATEST

You're welcome

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