change this code:
Code:
plug_mc.onRelease = plug_mc.onReleaseOutside = function(){
stopDrag();
this._rotation = 0;
down = false;
if(this.hitTest(socket_mc)){
trace("Connected!");
} else {
plug_mc._x = 190
plug_mc._y = 190
}
}
to this:
Actionscript Code:
plug_mc.onRelease = plug_mc.onReleaseOutside = function(){
stopDrag();
this._rotation = 0;
down = false;
}
and change this code:
Code:
onMouseMove = function(){
if(down){
plug_mc._rotation = Math.atan2(b, a)*180/Math.PI;
a = _root._xmouse - plug_mc._x;
b = _root._ymouse - plug_mc._y;
}
}
to this:
Actionscript Code:
onMouseMove = function(){
if(down){
if(plug_mc.hitTest(socket_mc)){
trace("Connected!");
}
plug_mc._rotation = Math.atan2(b, a)*180/Math.PI;
a = _root._xmouse - plug_mc._x;
b = _root._ymouse - plug_mc._y;
}
}