in a book i have i found a way to shoot things with a limit of them on the screen. The problem is , i think, the way i am referencing them. When i make them visible all the time only one of them works, and the others just stay at the top.
maxMis = 10;
for (i=0; i<maxMis; i++) {
attachMovie("missile", "missile"+i, i);
missile = _root["missile"+i];
missile._visible = false
missile.fired = false;
}
onEnterFrame = function () {
for (i=0; i<maxMis; i++) {
missile = _root["missile"+i];
onMouseDown = function () {
if (!missile.fired) {
missile.visible = true;
missile.fired = true;
missile._x = _xmouse;
missile._y = _ymouse;
}
};
if (missile.fired) {
missile._y -= 10;
if (missile._y<0) {
missile._visible = false;
missile.fired = false;
}
}
}
};
does anyone know why? Or a different way to reference them