# \[AS3\] enemy spawn on certain Time to a certain location on stage. FPS game

**URL:** https://forum.kirupa.com/t/as3-enemy-spawn-on-certain-time-to-a-certain-location-on-stage-fps-game/325912
**Category:** programming
**Created:** [November 11, 2011, 2:47pm UTC](https://forum.kirupa.com/t/as3-enemy-spawn-on-certain-time-to-a-certain-location-on-stage-fps-game/325912 "2011-11-11T14:47:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kestor](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kestor](https://forum.kirupa.com/u/kestor)
#### Post date: [November 11, 2011, 2:47pm UTC](https://forum.kirupa.com/t/as3-enemy-spawn-on-certain-time-to-a-certain-location-on-stage-fps-game/325912/1 "2011-11-11T14:47:31Z")

</div>

Hello there. Im creating a first person shooter.  
Im trying for 2-3 hours to add some enemys on the stage (from library) at certain seconds on a certain location).  
With the following code i get no errors but the enemys wont spawn.

```auto

stop();

import flash.utils.Timer;
import flash.events.Event;

var enemy1Timer:Timer;
enemy1Timer=new Timer(1200, 1);
enemy1Timer.start();
    
    
    
var enemy1Array;
enemy1Array=new Array();

addEventListener(Event.ENTER_FRAME, enemy1spawn);
function enemy1spawn(event:Event):void
{
    var Enemy1MC=MovieClip;
    Enemy1MC=new Enemy1();
    if(enemy1Timer.currentCount==1000)
    {
        Enemy1MC.x=400;
        Enemy1MC.y=400;
        addChild(Enemy1MC);
        enemy1Array.push(Enemy1MC);
    }
}

```

I also tried to spawn enemys without a timer and it worked but it spawns too many, so i think its a problem with the Timer.  
Theres no enemy AS file, just the linkage, since i dont have what code to put in there. all the code will be on main timeline.

What could be the problem with my code?  
Thanks in advance.
