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.

Listeners enable different pieces of code to cooperate because multiple listeners can receive<br />

notification about a single event.<br />

See also<br />

addListener (Key.addListener method)<br />

PGDN (Key.PGDN property)<br />

public static PGDN : Number<br />

The key code value for the Page Down key (34).<br />

Example<br />

The following example rotates a movie clip called car_mc when you press the Page Down <strong>and</strong><br />

Page Up keys.<br />

var keyListener:Object = new Object();<br />

keyListener.onKeyDown = function() {<br />

if (Key.isDown(Key.PGDN)) {<br />

car_mc._rotation += 5;<br />

} else if (Key.isDown(Key.PGUP)) {<br />

car_mc._rotation -= 5;<br />

}<br />

};<br />

Key.addListener(keyListener);<br />

PGUP (Key.PGUP property)<br />

public static PGUP : Number<br />

The key code value for the Page Up key (33).<br />

Example<br />

The following example rotates a movie clip called car_mc when you press the Page Down <strong>and</strong><br />

Page Up keys.<br />

var keyListener:Object = new Object();<br />

keyListener.onKeyDown = function() {<br />

if (Key.isDown(Key.PGDN)) {<br />

car_mc._rotation += 5;<br />

} else if (Key.isDown(Key.PGUP)) {<br />

car_mc._rotation -= 5;<br />

}<br />

};<br />

Key.addListener(keyListener);<br />

Key 357

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

Saved successfully!

Ooh no, something went wrong!