AS3: Main, for updated people!
Here is a tutorial about global buttons, because everyone is complaining about that you can't add code's inside the button!
1. We start with a new Flash file with AS3:
2. Press F9 on the main stage to open the actions window.
3. Add this line to the actions window:
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouse);
This creates and listener (in as2 an clipevent) and it gives a mouse down function and the property mouse.
4. Under the previous line add this one:
function mouse(event:MouseEvent):void {
nextframe();
}
This triggers the mouse function and then it goes to the next frame.
5. Close the actions window.
6. Right click in the timeline on the second frame.
7. Select insert keyframe and draw something.
8. If you press ctrl enter and you press once you can see it going to the drawing!
Here are some things you can add here:
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouse);
On the thick word you can add these functions:
CLICK if you click
DOUBLE_CLICK if you click twice
FOCUS_IN when you highlight it
FOCUS_OUT when you highlight another thing
KEY_DOWN when you press a key
KEY_FOCUS_CHANGE when you press another key
KEY_UP when you release a key
MOUSE_DOWN when you press the mouse
MOUSE_FOCUS_CHANGE when you focus on a other object
MOUSE_MOVE when you move the mouse
MOUSE_OUT when you move your mouse away
MOUSE_OVER when you roll over the object
MOUSE_UP when you release the mouse
MOUSE_WHEEL when you roll with the mouse wheel
ROLL_OUT when you move away
ROLL_OVER when you move over it
TAB_CHILDREN_CHANGE when the tab children flag change
TAB_ENABLED_CHANGE when the tab enabled flag change
TAB_INDEX_CHANGE when the tab index flag change
I hope it helps!
I still need to find out how the normal buttons work!