03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

■ load The action is initiated as soon as the movie clip is instantiated <strong>and</strong> appears in the<br />

Timeline.<br />

■ unload The action is initiated in the first frame after the movie clip is removed from the<br />

Timeline. The actions associated with the Unload movie clip event are processed before<br />

any actions are attached to the affected frame.<br />

■ enterFrame The action is triggered continually at the frame rate of the movie clip. The<br />

actions associated with the enterFrame clip event are processed before any frame actions<br />

that are attached to the affected frames.<br />

■ mouseMove The action is initiated every time the mouse is moved. Use the _xmouse <strong>and</strong><br />

_ymouse properties to determine the current mouse position.<br />

Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is<br />

true.<br />

■ mouseDown The action is initiated when the left mouse button is pressed.<br />

Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is<br />

true or System.capabilities.hasStylus is true.<br />

■ mouseUp The action is initiated when the left mouse button is released.<br />

Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is<br />

true or System.capabilities.hasStylus is true.<br />

■ keyDown The action is initiated when a key is pressed. Use Key.getCode() to retrieve<br />

information about the last key pressed.<br />

■ keyUp The action is initiated when a key is released. Use the Key.getCode() method to<br />

retrieve information about the last key pressed.<br />

■ data The action is initiated when data is received in a loadVariables() or loadMovie()<br />

action. When specified with a loadVariables() action, the data event occurs only once,<br />

when the last variable is loaded. When specified with a loadMovie() action, the data<br />

event occurs repeatedly, as each section of data is retrieved.<br />

Example<br />

The following example uses onClipEvent() with the keyDown movie event <strong>and</strong> is designed to<br />

be attached to a movie clip or button. The keyDown movie event is usually used with one or<br />

more methods <strong>and</strong> properties of the Key object. The following script uses Key.getCode() to<br />

find out which key the user has pressed; if the pressed key matches the Key.RIGHT property,<br />

the playhead is sent to the next frame; if the pressed key matches the Key.LEFT property, the<br />

playhead is sent to the previous frame.<br />

onClipEvent (keyDown) {<br />

if (Key.getCode() == Key.RIGHT) {<br />

this._parent.nextFrame();<br />

} else if (Key.getCode() == Key.LEFT) {<br />

68 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!