A couple of shouldn'ts... You shouldn't nest named functions. You shouldn't place code on objects... but we'll pass on that for now. Try using the following code on the object...
this.startX = 475.3; // use this._x instead of 475.3
this.startY = 98.0; // use this._y instead of 98.0
_root.AmpmeterCorrect = true;
And place the following code in a frame on the timeline that conatins the dragged movieclip...
var goBackX = new Tween(mc, "_x", Bounce.easeOut, mc._x, mc.startX, .2, true);
var goBackY = new Tween(mc, "_y", Bounce.easeOut, mc._y, mc.startY, .2, true);
Thanks that work great. Just have to move it in to all other movie clips now.
I'm going to be a pain again
how would i use this for a reset button which when they are all correct and locked to their target locations tweens them all back.
At the moment I have the following code.
_root.BatteryCorrect = false;
_root.VoltmeterCorrect = false;
_root.AmpmeterCorrect = false;
_root.ResistorCorrect = false;
Would it be a simple case of putting
MC_Ampmeter.startX = 475.3;
MC_Ampmeter.startY = 98.0;
in place for each one?
One should... You should try things... it rewarding when something you think about works. Each piece will already have its startX and startY assigned if it has been dragged, so there's no need to assign them again. I would use an on(release) instead of an on(press).
Thanks, you got it working.
I didn't exactly do much lol.