Needed help in Action Script 3.0
Hello Everyone.
what im creating-
okay so i'm creating a simple drag and drop application, in which you have to drag and drop (CAR) Letters in a right sequence.
what i want to do-
after you drop letters in a right sequence i want to run congratulation clip or animation.
here is my code-
/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/
R.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
{
R.startDrag();
}
R.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
{
R.stopDrag();
if(R.dropTarget!=null&&R.dropTarget.parent==box03)
{
trace("Sahi hai")
R.x=box03.x
R.y=box03.y
}
else
{
trace("Galat hai")
R.x=151.1
R.y=167.5
}
}
/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/
A.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
function fl_ClickToDrag_2(event:MouseEvent):void
{
A.startDrag();
}
A.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
function fl_ReleaseToDrop_2(event:MouseEvent):void
{
A.stopDrag();
if(A.dropTarget!=null&&A.dropTarget.parent==box02)
{
trace("Sahi hai")
A.x=box02.x
A.y=box02.y
}
else
{
trace("Galat hai")
A.x=261.15
A.y=167.5
}
}
/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/
C.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
function fl_ClickToDrag_3(event:MouseEvent):void
{
C.startDrag();
}
C.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);
function fl_ReleaseToDrop_3(event:MouseEvent):void
{
C.stopDrag();
if(C.dropTarget!=null&&C.dropTarget.parent==box01)
{
trace("Sahi hai")
C.x=box01.x
C.y=box01.y
}
else
{
trace("Galat hai")
C.x=371.05
C.y=167.5
}
}
