# Big problem... F8AS2

**URL:** <https://forum.kirupa.com/t/big-problem-f8as2/210020>\
**Category:** flash\
**Created:** [December 14, 2006, 4:12am UTC](https://forum.kirupa.com/t/big-problem-f8as2/210020 "2006-12-14T04:12:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fw2803](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@fw2803](https://forum.kirupa.com/u/fw2803)\
**Post date:** [December 14, 2006, 4:12am UTC](https://forum.kirupa.com/t/big-problem-f8as2/210020/1 "2006-12-14T04:12:19Z")

</div>

Flash 8  
ActionScript 2.0

Hi there

I am creating a helicopter game. There are four weapon carriers on the helicopter called “weapon\_carrier1”, “weapon\_carrier2”, “weapon\_carrier3” and “weapon\_carrier4”.

Players can choose:

1. to fire the missile from tube 1 (Keycode: 49)
2. to fire the missile from tube 2 (Keycode: 50)
3. to fire the missile from tube 3 (Keycode: 51)
4. to fire the missile from tube 4 (Keycode: 52)  
(this design is for later use as I plan to allow players to attach different missiles and bombs)

**When I press (49), the missile(a) is fired from tube 1. However, when I press (49) again, (a) disappeared and a new one is launched at tube 1. How can this problem be solved?**  
Here is the code on “weapon\_carrier1” (i.e. tube 1):  
onClipEvent (enterFrame) {  
//motion  
speed = 50  
if (Key.isDown (49)) {  
this.attachMovie(“missile1”,“missile1”,0)  
this.missile1.\_x = 0  
this.missile1.\_y = 0;  
}  
this.missile1.\_y -= speed  
this.missile1.gotoAndStop(‘fly’);  
}  
I don’t want the player to fire missiles like mad because it is mad already as there are _**[COLOR=red]4[/COLOR]**_ firing tubes on the helicopter!
