# HitTest Help! (I'm awful at Flash)

**URL:** <https://forum.kirupa.com/t/hittest-help-im-awful-at-flash/285542>\
**Category:** flash\
**Created:** [April 2, 2009, 4:52am UTC](https://forum.kirupa.com/t/hittest-help-im-awful-at-flash/285542 "2009-04-02T04:52:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thejoeknows\_com](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@thejoeknows\_com](https://forum.kirupa.com/u/thejoeknows_com)\
**Post date:** [April 2, 2009, 4:52am UTC](https://forum.kirupa.com/t/hittest-help-im-awful-at-flash/285542/1 "2009-04-02T04:52:46Z")

</div>

So I took a year+ break from flash, and i was awful before that anyways

but im having trouble getting my hittest to work with

this is what i have for the collision part of my code:  
(note:this is all in main frame)

```auto
function Collision():void {
    for (var i = 0; i < level.mc.numChildren; i++) {
        switch (getQualifiedClassName(level.mc.getChildAt(i))) {
            case "Building" :
            case "Border" :
            case "Etc" :
            case "Building2" :
                hit_test(hero.mc,level.mc.getChildAt(i),false);
                break;
        }
    }
}

if (hero.mc.hitTestObject(building2)){
    gotoAndPlay(1);
}

```

When hero.mc collides with building2 (also a mc) id like the whole game to go to frame 1

thank you for any help 😃

-tjk
