ver1

by 0hhaaaa forked from ver1 (diff: 2)
♥0 | Line 34 | Modified 2014-06-23 23:44:24 | MIT License
play

ActionScript3 source code

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

// forked from 0hhaaaa's ver1
package {
    
    import flash.display.*;
    import flash.events.*;
    import flash.text.*;
    import flash.geom.*;
    
    [SWF(width=800, height=600, backgroundColor="#c0c0c0", frameRate=30)]

    
    public class Ver1 extends Sprite {
        
        public var label1:TextField;
        public var num:uint;
        public var rect:Rectangle;
        
        public function Ver1():void {
            
            rect = new Rectangle(0,0,800,600);
            
            stage.addEventListener(MouseEvent.MOUSE_MOVE,loop);

            label1 = new TextField();
            
            var Tf:TextFormat = new TextFormat();
            Tf.font = "Arial Tur";
            Tf.size = 12;
            Tf.color = 0x000000;
            Tf.bold = true;
            
            label1.defaultTextFormat = Tf;
            label1.x = 50;
            label1.y = 20;
            label1.autoSize = TextFieldAutoSize.LEFT;
            
            stage.addChild(label1);
            scrollRect = rect;
            
        }
        public function loop(e:Event):void{
            rect.x = mouseX;
            rect.y = mouseY;
            label1.text = "X: "+rect.x+", Y: "+rect.y;
            scrollRect = rect;
        }

    }
}