MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 72

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

The action is initiated when the left mouse button is pressed.
mouseDown
Note: This event is supported in Flash Lite only if
or
true
System.capabilities.hasStylus
The action is initiated when the left mouse button is released.
mouseUp
Note: This event is supported in Flash Lite only if
or
true
System.capabilities.hasStylus
The action is initiated when a key is pressed. Use
keyDown
information about the last key pressed.
The action is initiated when a key is released. Use the
keyUp
retrieve information about the last key pressed.
The action is initiated when data is received in a
data
action. When specified with a
when the last variable is loaded. When specified with a
event occurs repeatedly, as each section of data is retrieved.
Example
The following example uses
be attached to a movie clip or button. The
more methods and properties of the Key object. The following script uses
find out which key the user has pressed; if the pressed key matches the
the playhead is sent to the next frame; if the pressed key matches the
playhead is sent to the previous frame.
onClipEvent (keyDown) {
if (Key.getCode() == Key.RIGHT) {
this._parent.nextFrame();
} else if (Key.getCode() == Key.LEFT) {
this._parent.prevFrame();
}
}
The following example uses
The _
and _
xmouse
ymouse
moves, which appears in the text field that's created at runtime.
onClipEvent (load) {
this.createTextField("coords_txt", this.getNextHighestDepth(), 0, 0, 100,
22);
coords_txt.autoSize = true;
coords_txt.selectable = false;
}
onClipEvent (mouseMove) {
coords_txt.text = "X:"+_root._xmouse+",Y:"+_root._ymouse;
}
72
ActionScript language elements
loadVariables()
with the
onClipEvent()
keyDown
with the
onClipEvent()
properties track the position of the mouse each time the mouse
System.capabilities.hasMouse
is
.
true
System.capabilities.hasMouse
is
.
true
Key.getCode()
Key.getCode()
loadVariables()
action, the
data
loadMovie()
movie event and is designed to
keyDown
movie event is usually used with one or
Key.LEFT
and
load
mouseMove
is
is
to retrieve
method to
or
loadMovie()
event occurs only once,
action, the
data
Key.getCode()
property,
Key.RIGHT
property, the
movie events.
to

Advertisement

Table of Contents
loading

Table of Contents