import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
var _theyArePressed:Object = {};
stage.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onUp);
function onUp(e:KeyboardEvent):void
{
_theyArePressed[e.keyCode] = false;
}
function onDown(e:KeyboardEvent):void
{
_theyArePressed[e.keyCode] = true;
if (_theyArePressed[Keyboard.SPACE] && _theyArePressed[Keyboard.UP])
{
trace("ockey");
//do anything
}
}
WHAT'S NEW?
Loading...
Multi Keyboard Event AS3
- Judul : Multi Keyboard Event AS3
- Penulis : PF studio
- Kategori : Code Snippets
-
Rating : 100% based on 10 ratings. 5 user reviews.
Item Reviewed: Multi Keyboard Event AS3
9 out of 10 based on 10 ratings. 9 user reviews.
facebook
twitter
google+
fb share