i have an MC (hand) that ive made to be draggable. once the hand is released it should return to its original position…but of course, it doesnt.
the code is a slight variation of some i found a while back and have kept in a folder.
first frame on code layer in main timeline
hand.elasticPos = function(targetX, targetY, accel, convert) {
tellTarget (this) {
xPos = xPos * accel + (targetX - _x) * convert;
yPos = ypos * accel + (targetY - _y) * convert;
_x += xPos;
_y += yPos;
}
};
on the ‘hand’ MC
onClipEvent (load) {
x = _root.hand._x;
y = _root.hand._y;
}
onClipEvent (enterFrame) {
if (!pressed) {
elasticPos(x, y, .9, .5);
// elasticPos( targetX, targetY, accel, convert);
}
}
and finally inside the hand MC is a button for draggable reasons, on which is…
on (press) {
//ignore this stuff...
_root.LEN.gotoAndStop("LEP");
_root.REN.gotoAndStop("REP");
_root.LEB.gotoAndStop("LEBP");
_root.MN.gotoAndStop("MP");
// end of ignore
this.startDrag();
pressed = true;
}
on (release, releaseOutside) {
this.stopDrag();
//ignore this stuff...
_root.LEN.gotoAndStop("LEN");
_root.REN.gotoAndStop("REN");
_root.LEB.gotoAndPlay("LEBN");
_root.MN.gotoAndStop("MN");
//end
pressed = false;
}
yeh. it doesnt work.
any help would be fantastic
its probably something blindinly obvious but ive been messing with actionscript all day and its all starting to blur… 
ive included the original file