# AHHH Code problem

**URL:** <https://forum.kirupa.com/t/ahhh-code-problem/241336>\
**Category:** flash\
**Created:** [October 12, 2007, 9:50am UTC](https://forum.kirupa.com/t/ahhh-code-problem/241336 "2007-10-12T09:50:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slayerX2](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@slayerX2](https://forum.kirupa.com/u/slayerX2)\
**Post date:** [October 12, 2007, 9:50am UTC](https://forum.kirupa.com/t/ahhh-code-problem/241336/1 "2007-10-12T09:50:50Z")

</div>

ok so I’ve been working on my game right but whats happening is switching between weapons, right and this time i got some code, but its not exactly working the way it should be please help

```auto
onClipEvent(load){
    this._visible = 0;
    touching = false;
}
onClipEvent(enterFrame){
    if(this.hitTest(_root.WT) and touching == false){
        touching = true;
        switch_weapon = _global.new_weapon1;
        _parent.gotoAndPlay("W2");
    } else {
        touching = false;
    }
}

```
