instance name problem breaks my brain
how can i create a instance name for a MovieClip Child?
cuz i want 2 make a hittest with a MovieClip Child heres my code:
Var ID = setInterval( createCopy, 1000 );
var counter = 900;
function createCopy(){
var c:MovieClip = new bulb();
addChild(c);
c.x = Math.random() * stage.stageWidth;
counter--;
if( counter <= 0 ){
clearInterval( ID );
}
}
i want to make a hittest i have tried this:
if(c.hitTestObject(player))
{
lives--;
}
but i doent work it says theres nothing that has a instance name of c
but what i dont understand is how dit the c.x = Math.random()*stage.stageWidth; code worked?
please answer i ive been stuck on this the hole day