Attach movieclip problem

I’ve been playing around with the attach movie code but I’m having a problem, I have two attach movie codes on one frame. Theres one for explosion and one for bullets. For some reason the explosion keeps dissapearing and coming back in a different place when its not supposed to. Also the animation for the explosion just goes back to where it was right before it moved. I do know the errors in here somewhere (really long):

 
explosionNum = 0;
function newEnemy() {
    attachMovie("explosion","explosion"+explosionNum,explosionNum+1);
      var explosion = eval("explosion"+explosionNum); 
   explosionNum++;
 
    explosion._x = Math.random()*(500-50)+50;
    explosion._y = Math.random()*(350-50)+50;
 
    explosion.onEnterFrame = function() {
        explosion.x = explosion._x;
        explosion.y = explosion._y;
 
    };
}
newEnemyInt = setInterval(newEnemy, 1000+random(500));
 
bulletNum = 0;
function newEnemy2() {
    attachMovie("bullet","bullet"+bulletNum,bulletNum+1);
 
      var bullet = eval("bullet"+bulletNum); 
 
   bulletNum++;
 
    bullet._x = Math.random()*(500-50)+50;
    bullet._y = Math.random()*(350-50)+50;
 
 bullet.onEnterFrame = function() {
        bullet.x = bullet._x;
        bullet.y = bullet._y;
    };
}
newEnemy2Int = setInterval(newEnemy2, 1000+random(500));

Thanks :slight_smile: