on()

Availability

Flash Lite 1.0.

Usage

on(event) {
    // statement(s) 
}

Operands

statement(s) The instructions to execute when event occurs.

event  This trigger is called an event. When a user event occurs, the statements following it within curly braces ({}) execute. Any of the following values can be specified for the event parameter:

Description

Event handler; specifies the user event or keypress that triggers a function. Not all events are supported.

Example

The following code, which scrolls the myText field down one line when the user presses the 8 key, tests against maxscroll before scrolling:

on (keyPress "8") {
    if (myText.scroll < myText.maxscroll) {
        myText.scroll++;
    }
}