flash on 2009-8-4

by hacker_9p8x8mco
♥0 | Line 25 | Modified 2009-08-04 18:34:07 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.TextField;
    
    public class FlashTest extends Sprite {
        
        private var tfX:TextField;
        private var tfY:TextField;
        
        public function FlashTest() {
                       
            tfX = new TextField();
            tfY = new TextField();
            
            addChild(tfX);
            addChild(tfY);
            
            tfX.border = tfY.border = true;//テキストフィールドの枠線
            tfX.width = tfY.width = 60;//
            tfX.height = tfY.height = 18;//高さ
            
            tfX.x = 130;//横座標
            tfY.x = 200;//横座標
            tfX.y = tfY.y = 20;//縦座標
            
//            addEventListener(Event.ENTER_FRAME, enterFrame);
        }
        
        private function enterFrame(evt:Event):void {
        
            tfX.text = String(stage.mouseX);
            tfY.text = String(stage.mouseY);
        }
        
    }
}