emerald511
02-11-2008, 04:22 AM
function flyAway(event:MouseEvent):void{
if (ladybugMagnet_mc.x < 250);
(ladybugMagnet_mc.y < 150); {
ladyBug_mc.x+=7;
ladyBug_mc.y-=7;}
else {
ladyBug_mc.x+=0;
ladyBug_mc.y+=0;}
}
play_mc.addEventListener(MouseEvent.CLICK, flyAway);
My code works however, even if the ladybugMagnet_mc is not in the place I have stated, the ladyBug_mc still moves. How can I fix that? Also is there a way to keep the bug moving until its off the screen rather than constantly clicking?
if (ladybugMagnet_mc.x < 250);
(ladybugMagnet_mc.y < 150); {
ladyBug_mc.x+=7;
ladyBug_mc.y-=7;}
else {
ladyBug_mc.x+=0;
ladyBug_mc.y+=0;}
}
play_mc.addEventListener(MouseEvent.CLICK, flyAway);
My code works however, even if the ladybugMagnet_mc is not in the place I have stated, the ladyBug_mc still moves. How can I fix that? Also is there a way to keep the bug moving until its off the screen rather than constantly clicking?