class DogLoader{ private var timeline:MovieClip; private var movie:MovieClip; public function DogLoader(_timeline:MovieClip, level:Number){ timeline = _timeline; renderDogs(level); } private function renderDogs(level:Number){ var xpos = Math.floor(Math.random()*Stage.width); var ypos = Math.floor(Math.random()*Stage.height); var scale = Math.random()*100 + 50; trace("x = " + xpos); trace("y = " + ypos); movie = timeline.attachMovie("d", "dog"+level, level, {_x:xpos, _y:ypos, _xscale:scale, _yscale:scale}); movie.onRollOver = function(){ this.gotoAndPlay(2); } movie.onRollOut = function(){ this.gotoAndStop(1); } } }