To create a button in AS3 go to the actions panel on the frame that the button is in and paste the following code
You will need to first create an INSTANCE for your button by selecting the button and going to properties.
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(2);
}
change my_btn to the instance you created for your button.
you can change the parameters gotoandstop(2); to any action you want the button to take so if you want that to open a URL you can modify that line of the code, but the rest of the code will stay the same in order to give the button its property configuration
If you want to add several button actions on the same frame you will need to make the function unique by renaming mouseDownHandler
I simply add a 1 and increase the number to make things easy. Below is an example:
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(2);
}
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent):void {
gotoAndStop(2);
}
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler3);
function mouseDownHandler3(event:MouseEvent):void {
gotoAndStop(2);
}

Pingback: livraison colis