# \[FlashCS4/AS2\]Need to switch clips and shoot

**URL:** <https://forum.kirupa.com/t/flashcs4-as2-need-to-switch-clips-and-shoot/291468>\
**Category:** flash\
**Created:** [June 30, 2009, 6:57am UTC](https://forum.kirupa.com/t/flashcs4-as2-need-to-switch-clips-and-shoot/291468 "2009-06-30T06:57:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JB\_Duart](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@JB\_Duart](https://forum.kirupa.com/u/JB_Duart)\
**Post date:** [June 30, 2009, 6:57am UTC](https://forum.kirupa.com/t/flashcs4-as2-need-to-switch-clips-and-shoot/291468/1 "2009-06-30T06:57:23Z")

</div>

I’m trying to make a small simple horizontal shooter game and I want to switch out my player\_mc to my playershoot\_mc and then make the playershoot\_mc shoot a bullet, the switch and the shooting i want to occur simultaneously when I hit the space bar. Having difficulty first off getting the movie clip to switch and then to get it to shoot. help? will post code (took out my bullet attempts to make it shorter…it failed to say the least haha)

```auto
var speed=3;

function playerMove() {
    if (Key.isDown(Key.LEFT)){
        player_mc._x-=speed;
        player_mc.play();
        player_mc._xscale !=-100;
    }
    if (Key.isDown(Key.RIGHT)){
        player_mc._x+=speed;
        player_mc.play();
        player_mc._xscale != 100;
    }
    if (Key.isDown(Key.SPACE)){
        removeMovieClip("player_mc");
        player_mc.attachMovie("shoot", "shoot_mc", 1);
        
    }
}

setInterval(playerMove, 10);

```
