on()
33
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:
■
press
The button is pressed while the pointer is over the button.
■
release
The button is released while the pointer is over the button.
■
rollOut
The pointer rolls outside the button area.
■
rollOver
The pointer rolls over the button.
■
keyPress "
key
"
The specified key is pressed. For the key portion of the parameter,
specify a key code or key constant.
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.+;
}
}
Summary of Contents for FLASH 8-FLASH
Page 1: ...Flash Lite 1 x ActionScript Language Reference...
Page 6: ...6 Contents...
Page 46: ...46 Flash Lite Global Functions...
Page 62: ...62 Flash Lite Properties...
Page 76: ...76 Flash Lite Statements...
Page 110: ...110 Flash Lite Operators...
Page 162: ...162 Index...