--------------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN ACTION SCRIPT PANEL
Download Source File:
http://bit.ly/1yL4DAp
https://www.youtube.com/watch?v=V_FxgUkreek
---------------------------------------------------------------------------------------------------------------
//First Make GreenBoxMc And Double Click This Movie And Draw reply_txt Box
//Second Make DragMeTarget MovieClip
//Third Make DragMe MovieClip
//Four Make Reset Button And Paste Below Code
// DragMe MOVIE CLIP SHOULD BE DRAG UNDER THE MOVIE BECAUSE IT DOESN'T WORK
var startX:Number;
var startY:Number;
DragMe.addEventListener(MouseEvent.MOUSE_DOWN,MouseDown)
function MouseDown(e:MouseEvent):void {
startX = e.target.x;
startY = e.target.y;
e.target.startDrag(true);
}
DragMe.addEventListener(MouseEvent.MOUSE_UP,MouseUp)
function MouseUp(e:MouseEvent):void {
e.target.stopDrag();
if (e.target.hitTestObject(getChildByName(e.target.name+"Target"))) {
e.target.x=getChildByName(e.target.name+"Target").x;
e.target.y=getChildByName(e.target.name+"Target").y;
e.target.removeEventListener(MouseEvent.MOUSE_DOWN,MouseDown)
e.target.removeEventListener(MouseEvent.MOUSE_UP,MouseUp)
GreenBoxMc.reply_txt.text = "Good Job!"
}
else {
e.target.x=startX;
e.target.y=startY;
GreenBoxMc.reply_txt.text = "Try Again!"
}
}
EmoticonEmoticon