Does anyone here know how to create a lock-on effect in Flash? I'm talking about dragging an object with the mouse and if you release it over a specific area, it would lock on in the right position. Here's an example of what I'm talking about (the way the clothes stick to the girl): http://www.onlydressupgames.com/dress-up-raya.php Any suggestions on how I should script this, what predefined functions to use, etc. are more than welcome Thanks.
Hi, the ._droptarget property is what you need: Here's a code snipet : The following example evaluates the _droptarget property of the garbage_mc movie clip instance and uses eval() to convert it from slash syntax to a dot syntax reference. The garbage_mc reference is then compared to the reference to the trashcan_mc movie clip instance. If the two references are equivalent, the visibility of garbage_mc is set to false. If they are not equivalent, the garbage instance resets to its original position. origX = garbage_mc._x; origY = garbage_mc._y; garbage_mc.onPress = function() { this.startDrag(); }; garbage_mc.onRelease = function() { this.stopDrag(); if (eval(this._droptarget) == trashcan_mc) { this._visible = false; } else { this._x = origX; this._y = origY; } }; You are welcome