# More shooting problems

**URL:** https://forum.kirupa.com/t/more-shooting-problems/213355
**Category:** Uncategorized
**Created:** [January 18, 2007, 10:34pm UTC](https://forum.kirupa.com/t/more-shooting-problems/213355 "2007-01-18T22:34:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mario\_hater](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mario\_hater](https://forum.kirupa.com/u/mario_hater)
#### Post date: [January 18, 2007, 10:34pm UTC](https://forum.kirupa.com/t/more-shooting-problems/213355/1 "2007-01-18T22:34:52Z")

</div>

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.

```auto
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
