OkAGOSTINI 第5号 マウスを追跡&押してる間だけ線を引く

by darman
♥0 | Line 27 | Modified 2010-11-09 21:56:32 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageQuality;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;
    
    public class FlashTest extends Sprite {
        
        public function FlashTest() {
            // write as3 code here..
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
        
        private function init(e:Event = null):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            stage.align = StageAlign.TOP_LEFT;
            stage.quality = StageQuality.HIGH;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            
            var cursorPoint:Sprite = new Sprite();
            cursorPoint.graphics.beginFill(0xff0000);
            cursorPoint.graphics.drawCircle(0, 0, 10);
            cursorPoint.graphics.endFill();
            addChild(cursorPoint);
            
            cursorPoint.x = stage.stageWidth / 2;
            cursorPoint.y = stage.stageHeight / 2;
            
            
        }
    }
}