var sayac:Number = 0;
labirentmc.addEventListener(MouseEvent.MOUSE_MOVE,oyunbitti);
topmc.addEventListener(MouseEvent.MOUSE_UP,birak);
topmc.addEventListener(MouseEvent.MOUSE_DOWN,tut);
function tut(e:MouseEvent):void
{
topmc.startDrag();
}
function birak(e:MouseEvent):void
{
topmc.stopDrag();
}
function oyunbitti(e:MouseEvent):void
{
sayac++;
trace(sayac);
if (sayac==3)
{
labirentmc.removeEventListener(MouseEvent.MOUSE_MOVE,oyunbitti);
topmc.removeEventListener(MouseEvent.MOUSE_UP,birak);
topmc.removeEventListener(MouseEvent.MOUSE_DOWN,tut);
trace(“oyun bitti”);
}
}
Hiç yorum yok :
Yorum Gönder