# WTF? CS5.5 hitTestObject!?

**URL:** <https://forum.kirupa.com/t/wtf-cs5-5-hittestobject/322449>\
**Category:** flash\
**Created:** [May 21, 2011, 8:38am UTC](https://forum.kirupa.com/t/wtf-cs5-5-hittestobject/322449 "2011-05-21T08:38:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheAwesomeDude](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@TheAwesomeDude](https://forum.kirupa.com/u/TheAwesomeDude)\
**Post date:** [May 21, 2011, 8:38am UTC](https://forum.kirupa.com/t/wtf-cs5-5-hittestobject/322449/1 "2011-05-21T08:38:09Z")

</div>

Hi!  
It was long time sense i play with Flash so i decided to start agian.  
I wrote this really easy code in AS3, in FLASH cs5.5:

```php
stop();

function OnStart(e:Event)
{
    
    if(player.hitTestObject(ground))
    {
        gotoAndStop('GameOver');
    }
    
}

player.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void
{
    player.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void
{
    player.stopDrag();
}

```

That means that i can drag my player and if the play htis “ground” nextframe should be played.  
BUT it doesnt work for some wierd reason? Why?
