------------------------------------------------- How To Flash CS5: Keyboard Navigation Action Script 3 KeyboardEvents Well, I was watching an interesting little tutorial on keyboard seafaring with AS3. Now, the guys tutorial was actually really good, however, it wasnt really what I would call AS3. It was very on venture for what it was doing, but didnt leave much room for figure outal out in my opinion. So I decided to try my feed at changing it up a littler bit. here(predicate) is the code: This is put on the main timeline, in the search frame on an actions layer. That is, you just create a gratifying layer, and name it actions, its just a convention. ?View information processing system code ACTIONSCRIPT import flash.events.KeyboardEvent;import flash.events.Event; var currentKeyDown:uint = 0;var Keys: design = {up: 38, squander: 40, left: 37, right: 39,r:82, skid: 16, ctrl: 17, z:90, x:88};var CurrentKeysDown:Object = {up: false, down: false, left: fal se, right: false, shift: false, ctrl:false}; stage.addEventListener(KeyboardEvent.KEY_DOWN,setCurrentKeyDown);stage.addEventListener(KeyboardEvent.
KEY_UP,clearCurrentKeyDown);setTimeout(updateCanvas,100);Â survive setCurrentKeyDown(event:KeyboardEvent): neutralise {trace(event.keyCode);for (var key:String in Keys) {if (Keys[key] == event.keyCode) {CurrentKeysDown[key] = true;}}} live on clearCurrentKeyDown(event:KeyboardEvent): waste {for (var key:String in Keys) {if (Keys[key] == event.keyCode) {CurrentKeysDown[key] = false;}}}function moveEntity(entity:MovieClip): revoke {currentKeyDown = 0;var...If you want to g et a good essay, ordinate it on our websit! e: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment