Moving multiple bullets

Hello, everyone!

I’m working on a simple top-down zombie shooter to teach me better AS3 practices. There’s one player, can shoot multiple bullets, and a certain number of zombies on screen at once, that increment by one when all of the previous ones are dead.

So, I have everything working great except for one thing: even though I’m spawning multiple bullets, and they go in the correct direction at the right speed, only one moves at a time.

Here’s the code for spawning bullets:

        // shoot - check to see if the gun can shoot, then shoot it
        private function shoot():void
        {
            numBullets = 1;
            bulletSpeed = 3;
            
            if(reloadComplete && clickedMouse) 
            {
                for(var i = 0; i < numBullets; i++) 
                {
                    bullet_mc = new Bullet();
                    bullet_mc.name = i;
                    
                    bulletAngle = player_mc.rotation * (Math.PI/180);
                    
                    bullet_mc.x = player_mc.x + (20 * Math.cos(bulletAngle));
                    bullet_mc.y = player_mc.y + (20 * Math.sin(bulletAngle));
                    
                    bullet_mc.xSpeed = Math.cos(bulletAngle) * bulletSpeed;
                    bullet_mc.ySpeed = Math.sin(bulletAngle) * bulletSpeed;
                
                    bulletArray* = bullet_mc;
                    stage.addChild(bullet_mc);
                }
            }
            
            fired = true;
            //reload();
        }

Here’s the code for moving the bullets:

        // moveBullets - move the fired bullet in the direction it was aimed
        private function moveBullets():void //evt:Event):void
        {
            for(var i = 0; i < bulletArray.length; i++)
            {
                bulletArray*.x += bulletArray*.xSpeed;
                bulletArray*.y += bulletArray*.ySpeed;
            }
        }

I have a similarly structured pair of functions for the zombies, and they chase after the player just fine. If I trace a bullet’s name when it collides with a zombie, it always returns 0. I’ve tried changing the number of bullets that can be spawned, but it remains the same.

Also, the moveBullets function is called from gameLoop(), which is itself called from an event listener for ENTER_FRAME. The movePlayer and moveZombies functions I have are also called from gameLoop. Don’t know if that helps.

I’m sure it’s a simple fix that I’m just not seeing. Any help regarding this is greatly appreciated!