Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- *
- * Lunette
- *
- * @author Didier Brun
- * @version 1.0
- *
- */
- package {
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.KeyboardEvent;
- import flash.ui.Keyboard;
- public class Lunette extends Sprite {
- // ------------------------------------------------
- //
- // ---o properties
- //
- // ------------------------------------------------
- public var tourelleh : TourelleHorizontale;
- // ------------------------------------------------
- //
- // ---o constructor
- //
- // ------------------------------------------------
- function Lunette(){
- addEventListener(Event.ADDED_TO_STAGE, init);
- }
- // ------------------------------------------------
- //
- // ---o public methods
- //
- // ------------------------------------------------
- // ------------------------------------------------
- //
- // ---o private methods
- //
- // ------------------------------------------------
- /**
- * init
- */
- private function init(e:Event):void{
- stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
- }
- /**
- * key down
- */
- private function keyDown(e : KeyboardEvent) : void {
- switch (e.keyCode){
- case Keyboard.UP:
- tourelleh.clic(1);
- break;
- case Keyboard.DOWN:
- tourelleh.clic(-1);
- break;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment