glenforest says
Here is a quick example I threw together: gotoFrameLabel You can download the source fla here but basically all it is is a timeline with 3 layers : timeline snapshot The Frames layer has the named frames (named “one”, “tow”, etc) The Buttons layer has five buttons, instance names btn1, btn2, etc, visicle across all layers. The Actions Layer has the following code:
 stop(); //for simple button function (single statement) you can use: btn1.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "one" )}); btn2.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "two" )}); btn3.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "three" )}); btn4.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "four" )}); btn5.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "five" )}); /* or for more complex functions use : btn1.addEventListener(MouseEvent.CLICK, btn1Funtion ); btn2.addEventListener(MouseEvent.CLICK, btn2Funtion ); ...etc funtion btn1Funtion() { gotoAndStop("one") ... etc } funtion btn2Funtion() { gotoAndStop("two") ... etc } ...etc */ 

I tried this, but got the following error:

1071: Syntax error: expected a definition keyword (such as function) after attribute funtion, not btn1Funtion.

Any ideas?

-toecutter

3 years ago in thread As3.0 Jump to frame of button click demo