Skip to main content
Participating Frequently
April 3, 2013
Question

Simple button script not working

  • April 3, 2013
  • 1 reply
  • 802 views

I am using AS2 and need help figuring out why this simple button script is not working:

stop();

buttonWS1.onRelease = function(){

                    gotoAndStop("Stage1and2_Boss",4);

};

buttonWS2.onRelease = function(){

                    nextFrame();

};

//end

My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.

I have no idea what is going on. Please help!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 3, 2013

buttonWS1 is problematic but buttonWS2 should work.  does it advance the timeline that contains that code to the next frame?

sjc77Author
Participating Frequently
April 3, 2013

Thanks for the response. Neither works. Neither advances the timeline. I have to put a continue button on the page for it to advance.

The strange thing is that at one point I got one of the puzzles to work as a button. But then i changed all the images, and I can't get even one of them to work.

Any ideas?

Message was edited by: sjc77

kglad
Community Expert
Community Expert
April 3, 2013

go to the frame that contains your button code.

click on the object you think is buttonWS2. 

1. check the properties panel to see if buttonWS2 is listed as that button's instance name.

2. make sure there's no code attached to that button

if both those check out, add a trace statement to that button's onRelease and check if the onRelease executes by clicking it and watching for the trace output.