// forked from 084's ボール package{ import flash.display.Sprite; import flash.events.Event; public class Test extends Sprite { private var ball:Ball; private var easing:Number = 0.2; public function Test() { ball = new Ball(); this.addChild(ball); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(e:Event):void { var vx:Number = (mouseX - ball.x) * easing; var vy:Number = (mouseY - ball.y) * easing; ball.x += vx; ball.y += vy; } } } import flash.display.Sprite; class Ball extends Sprite { private var hankei:Number; private var iro:uint; public function Ball(hanikei:Number = 10, iro:uint = 0x666666) { this.hankei = hanikei; this.iro = iro; init(); } private function init():void { graphics.beginFill(iro); graphics.drawCircle(0, 0, hankei); graphics.endFill(); } } forked from: ボール