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

Question about buttons in the script

New Here ,
Aug 31, 2014 Aug 31, 2014

So, I have a file where I have the action script all ready and working, and all the buttons working.  The whole file works perfectly.

But, when I make a new file and copy and paste the action script and buttons, it doesn't work!  I have the EXACT same script, and the file setting are the same as well.

Is it because I copied and pasted the actual buttons?  Or is it because of the script?  I've created new buttons, and modified the script to use their instance names, but that doesn't work either.

The weird thing is that 1 of the buttons I copied and pasted work!  I have 4 buttons total, and 3 of them change the FPS of the stage using this code -

button1.addEventListener(MouseEvent.CLICK, goNormal);

function goNormal(event:MouseEvent):void {

  stage.frameRate = 24

The button that does work uses this code -

button4.addEventListener(MouseEvent.CLICK, goEnd);

function goEnd(event:MouseEvent):void {

  gotoAndStop(1,"Scene 2");

}

I've even changed the functions around.  I've spent the last 4 hours trying to fix it, but apparently I can't.

Thanks!

TOPICS
ActionScript
253
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 ,
Aug 31, 2014 Aug 31, 2014

Check List

1. Check all instance names is match with script?

2. Check all assets is copied

3. Insert break point(ctrl+b) to code and run Debug(ctrl+shift+enter)

     -which line has bug? check that.

4. Is there any undefined assets?

5. Got error massage? search why that error is occurs

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 ,
Aug 31, 2014 Aug 31, 2014

I've checked all of that, and it all comes up okay, unfortunately.

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 ,
Aug 31, 2014 Aug 31, 2014

Would you please share that file to me?

let's figure this out.

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 ,
Aug 31, 2014 Aug 31, 2014

Ah, check this too

is Actionscript version is matched

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 ,
Aug 31, 2014 Aug 31, 2014
LATEST

Yup, the original is 3.0, and the new is 3.0

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