I am trying to have a movieclip ease into a random position. Then the mc is dragable and swaps depth with the other mc's in the movie.
Here is the code I have so far but my random positioning is interfering with the dragability of the mc. Once the mc eases into its random position if you try and drag it anywhere it wants to lock back to the x y coordinate that it randomly eased to...
Code:acceleration = 10 newpos = function () { ranx = Math.round((Math.random ()*250)); rany = Math.round ((Math.random ()*250)); } newpos(); this.onEnterFrame = function() { this._x += ((ranx-this._x)/acceleration); this._y += ((rany-this._y)/acceleration); }; drag9.onPress = function() { _root.slide9.startDrag(); _root.slide9.swapDepths(_root.getNextHighestDepth()); } drag9.onRelease = drag.onReleaseOutside = function() { _root.slide9.stopDrag(); }






Bookmarks