class com.player.Visuals extends MovieClip { // private var theRoot:MovieClip; private var numParticles:Number = 10; private var minDist:Number = 50; private var springAmount:Number = .001; private var vbounds:MovieClip; public function Visuals() {} public function init():Void { setMask (vbounds); for(var i:Number=0; i< numParticles;i++) { var particle:MovieClip = this.attachMovie("particle", "p" + i, i); particle._x = Math.random() * vbounds._width; particle._y = Math.random() * vbounds._height; particle.vx = Math.random() * 6 - 3; particle.vy = Math.random() * 6 - 3; particle._xscale = particle._yscale = 10 + Math.random() * 100; particle.mass = particle._xscale / 100; } // onEnterFrame = initAnimation; } private function onEnterFrame():Void { for(var i:Number = 0;i vbounds._width) { particle._x = vbounds._x; } else if(particle._x < -10) { particle._x = vbounds._width; } if(particle._y > vbounds._height) { particle._y = vbounds._y; } else if(particle._y < -46) { particle._y = vbounds._height; } } clear(); for(i=0;i