Drag and Drop game animated bounce back
Hi
What I am trying to do is make an animated bounce back for a drag and drop game, so if the object is dropped in a location that doesn't satisfy the hitTest it bounces back to a pre set location.
It seams simple but there is obviously something not working. Just so people know I am a total newby when it comes to coding in actionscript, so please be gentle as I probably won't understand what your talking about.
Anyway here is the code for the movie click which is being dragged.
on (press)
{
startDrag(this,false,0,0,600,400);
}
on (release)
{
stopDrag();
if (this.hitTest(_parent.MC_TargetAmpmeter))
{
this._x=_parent.MC_TargetAmpmeter._x;
this._y=_parent.MC_TargetAmpmeter._y;
_root.AmpmeterCorrect = true;
}
else
{
BounceBack.call(mx.transitions.easing.Bounce.easeOut);
function BounceBack(easetype)
{
var begin = getProperty(Ampmeter,_x);
var xEnd = 475.3;
var mc = Ampmeter;
Bounceback = new mx.transitions.Tween(mc, "_x", easeType, begin, xEnd, .2, true);
}
//this._x=475.3;
//this._y=98.0;
}
}
If you can help I will be very grateful
Thanks
DrTux