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;
}
See also
,
Key
_xmouse (MovieClip._xmouse property)
,
property)
on handler
ord function
ord(character:String) : Number
Deprecated since Flash Player 5. This function was deprecated in favor of the methods and
properties of the String class.
Converts characters to ASCII code numbers.
Availability: ActionScript 1.0; Flash Player 4
Parameters
- The character to convert to an ASCII code number.
character:String
with the
onClipEvent()
keyDown
with the
onClipEvent()
properties track the position of the mouse each time the mouse
,
updateAfterEvent function
movie event and is designed to
keyDown
movie event is usually used with one or
Key.LEFT
and
load
mouseMove
,
_ymouse (MovieClip._ymouse
to
Key.getCode()
property,
Key.RIGHT
property, the
movie events.
Global Functions
85
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?