AS3 :: Button Code

Here is the basic scripting/code for buttons:
I have added comments that are preceded with double slashes – // – to help explain them.
In the Actionscript window, they appear grey, as they do here.
If your function name or instance name turns blue or green, it has a particular meaning to Flash. BEWARE!

//functions. The function names are whatever you name them.
function goFrame(e:Event):void {
      gotoAndPlay(1,“framexframe”)
};
//This will go to frame 1 of scene “framexframe”

function goBitmap1(e:Event):void {
      gotoAndPlay(1,“bitmap”)
};
//This will go to frame 1 of scene “bitmap”

//buttons. Don’t forget to name the button instances on the stage!!

framexframe_btn.addEventListener (MouseEvent.CLICK, goFrame);
//executes the goFrame function from above when the button is clicked

bitmap_btn.addEventListener (MouseEvent.CLICK, goBitmap);
//executes the goBitmap function from above
//DON’T FORGET…the code is CASE SENSITIVE!