Arguments
object: The button name.
mouseEvent: One of the defined mouse / keyboard Events.
statements: A list of any valid scripting commands that are executed if the Event has occured.
Description
An Event Handler. Code is executed when the Mouse Event condition applies to the named button.
Unlike onSelfEvent(), the statements executed are with respect to the containing Object.
Sample
Stop Movie playing if button "btnStop" is pressed.
btnStop.on(press) {
this.stop(); // stops continaing sprite. If this button is contained by the main movie (_root.btnStop) then it stops the movie.