I am pretty new at arrays so I really need alittle help.
I want to dynamically load an certain number of mc’s into an array and then be able to remove the mc’s one by one. It’s for a multi-power-up game.
I tried a few different things and so now I am just stuck. I can get the mc’s to load into the array with no problem, I can get the array to trace the splice (ex: 1,1,1,1 - 1,1,1 - 1,1- 1) I just cant seem t get the mc to leave the array. I want it to show,say, 3 movieClips then I press the *[color=Red]A[/color] *key and it shows 2 movieClips.
Here is my code:
onClipEvent (enterFrame) {
if (this, hitTest(_root.me)) {
var bombBox:Array = [];
var bombLeft:Number = 4;
var xPos = 60;
var yPos = 30;
for (i=0; i<bombLeft; i++) {
bombBox* = 1;
_root.attachMovie("mc", "bomb"+i, i, {_x:xPos, _y:yPos});
xPos += _root["bomb"+i]._width+5;
_x = -20;
}
}
}
onClipEvent (enterFrame) {
if (Key.isDown(65) and bombBox>=0) {
bombBox.splice(0, 1);
trace(bombBox);
}
}
Any help would be great. Thanx!!