Error using Arrays
I am trying to use Array to count my boxMC. my boxMC is on my background of WorldMC. Its saying that my line of
"for (var count=0; count<boxMC.length; count++){
boxMC[count].update();
}"
Has no default value
Here is my error:
ReferenceError: Error #1069: Property update not found on tankscript.turrent.Box and there is no default value.
var boxMC:Array;
boxMC = new Array();
//------------------------------
// -----Box Spawning------------
//------------------------------
//only spawn a box if there are less tan 100 already on screen
while(WorldMC.numChildren<10)
{
// Make a new instance of the box class
var bx = new Box();
// add the box to the display list
WorldMC.addChild(bx);
//position and rotate the Box;
bx.x = Math.random() * -1100;
bx.y = Math.random() * 1;
bx.rotation = 40;
// add the box to list of box
boxMC.push(bx);
}
for (var count=0; count<boxMC.length; count++){
boxMC[count].update();
}
}
