hi all, i need a help. well i’m new here.
i have this this code to make a random catch game. so the problem is i cant go to the next frame. please someone help me.
here is my code:
stop();
var holder:Sprite = new Sprite();
addChild(holder);
for (var i:int; i<10; i++) {
var arrayAphid:Array = new Array();
holder.y = 500;
arrayAphid*= new aphids();
holder.addChild(arrayAphid*);
//**
arrayAphid*.buttonMode = true;
arrayAphid*.addEventListener(MouseEvent.CLICK, objectFound);
//**
arrayAphid*.x = Math.random()*stage.stageWidth;
arrayAphid*.y = Math.random()*stage.stageHeight;
//arrayAphid*.scaleX = arrayAphid*.scaleY = Math.random();
arrayAphid*.gotoAndPlay(Math.ceil(Math.random()*15));
}
//**
function objectFound(e:MouseEvent):void
{
var _found:int = arrayAphid*;
var aphids:MovieClip = e.currentTarget as MovieClip;
aphids.removeEventListener(MouseEvent.CLICK, objectFound);
// Set the object's visibility to false
aphids.visible = false;
_found--;
//trace('> ' + aphids.name + ': founded');
//trace('> objects founded: ' + _found);
if (_found == 0)
{
trace('> all founded');
nextFrame();
}
}