Hi there,
I need help on this following syntax to translate it into looping, as I will use it for a lot more movie clips. Please help me. Urgent T_T
var xPos:int;
var yPos:int;
var xPosK:int;
var yPosK:int;
nextbtn.visible=false;
ndragbtn.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
ndragbtn.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);
kdragbtn.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_4);
kdragbtn.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_4);
submitbtn.addEventListener(MouseEvent.CLICK, submit);
nextbtn.addEventListener(MouseEvent.CLICK, nextrandom);
homebtn.addEventListener(MouseEvent.CLICK, home);
function getPosition(ndragbtn):void
{
xPos = ndragbtn.x;
yPos = ndragbtn.y;
}
function getPosition1(kdragbtn):void
{
xPosK = kdragbtn.x;
yPosK = kdragbtn.y;
}
function fl_ClickToDrag_3(event:MouseEvent):void
{
getPosition(ndragbtn);
ndragbtn.startDrag();
}
function fl_ClickToDrag_4(event:MouseEvent):void
{
getPosition1(kdragbtn);
kdragbtn.startDrag();
}
function fl_ReleaseToDrop_3(event:MouseEvent):void
{
if (ndragbtn.hitTestObject(ndragbtnTarget))
{
ndragbtn.x = ndragbtnTarget.x;
ndragbtn.y = ndragbtnTarget.y;
ndragbtnTarget=ndragbtn;
}
else if(ndragbtn.hitTestObject(kdragbtnTarget))
{
ndragbtn.x = kdragbtnTarget.x;
ndragbtn.y = kdragbtnTarget.y;
}
ndragbtn.stopDrag();
kdragbtn.stopDrag();
}
function fl_ReleaseToDrop_4(event:MouseEvent):void
{
if (kdragbtn.hitTestObject(kdragbtnTarget))
{
kdragbtn.x = kdragbtnTarget.x;
kdragbtn.y = kdragbtnTarget.y;
kdragbtnTarget=kdragbtn;
}
else if(kdragbtn.hitTestObject(ndragbtnTarget))
{
kdragbtn.x = ndragbtnTarget.x;
kdragbtn.y = ndragbtnTarget.y;
}
kdragbtn.stopDrag();
ndragbtn.stopDrag();
}
function submit(event:MouseEvent):void
{
if(ndragbtn == ndragbtnTarget && kdragbtn == kdragbtnTarget)
{
statustxt.text=“Correct and you can proceed!”;
nextbtn.visible=true;
}
else{
statustxt.text=“Sorry please try again!”;
ndragbtn.x = xPos;
ndragbtn.y = yPos;
kdragbtn.x = xPosK;
kdragbtn.y = yPosK;
}
}
I do appreciate a quick reply from u guys