flash on 2011-1-2
♥0 |
Line 24 |
Modified 2011-01-02 23:33:56 |
MIT License
archived:2017-03-20 01:01:45
ActionScript3 source code
/**
* Copyright Ryogo_Quberey ( http://wonderfl.net/user/Ryogo_Quberey )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/4zfe
*/
package {
import flash.events.Event;
import flash.display.Sprite;
import flash.events.Event;
public class FlashTest extends Sprite {
private var maru:Sprite = new Sprite;
private var color:uint = 0xD8EB00;
private var speed:Number = 0.2;
public function FlashTest() {
maru = new Sprite();
maru.graphics.beginFill(color);
maru.graphics.drawCircle(0, 0, 20);
maru.graphics.endFill();
maru.x = stage.stageWidth/2;
maru.y = stage.stageHeight/2;
this.addChild(maru);
this.addEventListener(Event.ENTER_FRAME, MoveCircle);
}
private function MoveCircle(event:Event):void {
maru.x += (mouseX - maru.x)*speed ;
maru.y += (mouseY - maru.y)*speed ;
}
}
}