make test

by Nowloading_
♥0 | Line 59 | Modified 2010-09-22 02:31:41 | MIT License
play

ActionScript3 source code

/**
 * Copyright Nowloading_ ( http://wonderfl.net/user/Nowloading_ )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/10Kc
 */

// forked from ton_'s key up up left down right
package {
    import flash.display.*;
    import flash.events.*;
    import flash.text.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var x:int=0;
            var y:int=0;
            var tex:TextField;
            stage.addEventListener(KeyboardEvent.KEY_DOWN, xKeyDown);
 
            function xKeyDown(eventObject:KeyboardEvent):void {
                var nKeyCode:int = eventObject.keyCode;
                xMove(nKeyCode);
            }

            function xMove(nKeyCode:int):void {
                //37=left,39=light,38=up,40=down

                if (nKeyCode == 37) {
                    if (x==2){
                        graphics.lineStyle(2,0x000000);
                        graphics.lineTo(300,100+y);      
                        x = 3;                 
                    } 
                } else if (nKeyCode == 39) {
                    if (x==4){
                        graphics.lineStyle(2,0x000000);
                        graphics.lineTo(100,200+y);      
                        x = 0;  
                        y += 10;               
                    } 
                } else if (nKeyCode == 38) {
                    if (x==0){
                        graphics.lineStyle(2,0x000000);
                        graphics.lineTo(100,200+y);      
                        x = 1;                 
                    } else if (x == 1){
                        graphics.lineStyle(2,0x000000);
                        graphics.lineTo(300,200+y);
                        x = 2; 
                    }
                } else if (nKeyCode == 40) {
                    if (x==3){
                        graphics.lineStyle(2,0x000000);
                        graphics.lineTo(200,150+y);      
                        x = 4;                 
                    } 
                } 
            }
        }
    }
}



import flash.display.Sprite;
class modeCheck extends Sprite{
    public function modeCheck(){
    
    }
    public var cCheck:int = 0 ;
    public function Check():void{
        switch ( cCheck ) {
            
        }

    }

}