Sie sind auf Seite 1von 6

Modul

var sv:SharedObject;
var score:int=0;
var c:int=1;
var nyawa:int=3;
Action

var aa:int = 0;

k1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void
{
k1.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void
{
k1.stopDrag();
if (aa==0)
{
k1.x = 79.10;
k1.y = 329.70;
}
else
{
k1.removeEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

}
}

/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/

k2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

function fl_ClickToDrag_2(event:MouseEvent):void
{
k2.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

function fl_ReleaseToDrop_2(event:MouseEvent):void
{
k2.stopDrag();
if (aa==0)
{
k2.x = 274.85;
k2.y = 331.60;
}
else
{
k2.removeEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
}
}

/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/

k3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);

function fl_ClickToDrag_3(event:MouseEvent):void
{
k3.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);

function fl_ReleaseToDrop_3(event:MouseEvent):void
{
k3.stopDrag();
if (aa==0)
{
k3.x = 467.00;
k3.y = 327.20;
}
else
{
k3.removeEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
}
}


this.addEventListener(Event.ENTER_FRAME, fl_TimerHandler);



function fl_TimerHandler(event:Event):void
{
score2.text = String(score);
nyawa2.text = String(nyawa);
if ((k1.x > 271 && k1.x < 360) && (k1.y > 135 && k1.y < 213))
{
aa = 1;
k1.x = patokan.x;
k1.y = patokan.y;

hasil.text = "SALAH";
nyawa = nyawa - 1;
c = 0;

this.removeEventListener(Event.ENTER_FRAME, fl_TimerHandler);
k1.stopDrag();

fl_TimerInstance_2.start();
}

if ((k2.x > 271 && k2.x < 350) && (k2.y > 165 && k2.y < 213))
{
aa = 1;
k2.x = patokan.x;
k2.y = patokan.y;

hasil.text = "SALAH";
nyawa = nyawa - 1;
c = 0;

this.removeEventListener(Event.ENTER_FRAME, fl_TimerHandler);
k2.stopDrag();
fl_TimerInstance_2.start();
}

if (((k3.x > 271 && k3.x < 400) && (k3.y > 115 && k3.y < 213)) && c == 1)
{
aa = 1;
k3.x = patokan.x;
k3.y = patokan.y;

hasil.text = "BENAR";
score = score + 1;
c = 0;

this.removeEventListener(Event.ENTER_FRAME, fl_TimerHandler);
k3.stopDrag();
fl_TimerInstance_2.start();
}

}
/* Simple Timer
Displays a countdown timer in the Output panel until 30 seconds elapse.
This code is a good place to start for creating timers for your own purposes.

Instructions:
1. To change the number of seconds in the timer, change the value 30 in the first line below to the number
of seconds you want.
*/

var fl_TimerInstance_2:Timer = new Timer(1000,30);
fl_TimerInstance_2.addEventListener(TimerEvent.TIMER, fl_TimerHandler_2);


var fl_SecondsElapsed_2:Number = 1;

function fl_TimerHandler_2(event:TimerEvent):void
{
if (fl_SecondsElapsed_2>2)
{
fl_TimerInstance_2.removeEventListener(TimerEvent.TIMER, fl_TimerHandler_2);
gotoAndStop(2);
}

fl_SecondsElapsed_2++;
}

NEXT

btnlanjut.addEventListener(MouseEvent.CLICK, fl_h);

function fl_h(event:MouseEvent):void
{
MovieClip(this.root).gotoAndStop(27);
}

Das könnte Ihnen auch gefallen