function randomNumber (num) { ran = Math.random()*num; ran = Math.round(ran); // trace("random "+ran); return ran; } blob.onPress = function() { this.startDrag(); } blob.onRelease = function() { this.stopDrag(); } bob.onRollOver = function() { trace("on rollover works"); depthCounter += 1; trace(depthCounter); this.duplicateMovieClip("duplicate"+depthCounter,depthCounter); _root["duplicate"+depthCounter]._x = randomNumber(Stage.width); _root["duplicate"+depthCounter]._y = randomNumber(Stage.height); _root["duplicate"+depthCounter]._alpha = randomNumber(80); } xdirection = 10; ydirection = 10; sally.onEnterFrame = function() { this._x += xdirection; this._y += ydirection; if ((this._x > Stage.width - this._width/2) || (this._x < this._width/2)) { xdirection *= -1; } if ((this._y > Stage.height - this._height/2) || (this._y < this._height/2)) { ydirection *= -1; } }