package { import flash.display.MovieClip; import flash.events.*; import flash.utils.*; public class Circle extends MovieClip { public var count:int = 0; public function Circle() { var blah = setInterval(init, 10); } private function init() { var thiscircle:MovieClip = new MovieClip; thiscircle.graphics.beginFill(0x0000FF); thiscircle.graphics.drawCircle(0,0,1); thiscircle.graphics.endFill(); thiscircle.x = Math.floor(Math.random()*550); thiscircle.y = Math.floor(Math.random()*400); thiscircle.alpha = Math.random(); thiscircle.scaleX = Math.floor(Math.random()*10); thiscircle.scaleY = thiscircle.scaleX; thiscircle.addEventListener(Event.ENTER_FRAME,onEnterFrameMove); addChild(thiscircle); count++; if (count > 60) { removeChildAt(0); } } private function onEnterFrameMove(event:Event) { var me = event.target; var yEnd = mouseY; var xEnd = mouseX; me.x += (xEnd-me.x)/4; me.y += (yEnd-me.y)/4; } } }