# Code Error dont know why

**URL:** <https://forum.kirupa.com/t/code-error-dont-know-why/314877>\
**Category:** flash\
**Created:** [October 11, 2010, 6:56pm UTC](https://forum.kirupa.com/t/code-error-dont-know-why/314877 "2010-10-11T18:56:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![L\_E\_O](https://avatars.discourse-cdn.com/v4/letter/l/f19dbf/32.png) [@L\_E\_O](https://forum.kirupa.com/u/L_E_O)\
**Post date:** [October 11, 2010, 6:56pm UTC](https://forum.kirupa.com/t/code-error-dont-know-why/314877/1 "2010-10-11T18:56:21Z")

</div>

hey guys, i got this code from a Newgrounds tut,

```php

onClipEvent(enterFrame) {

    if(!touchingGround) {
        grav++;
        this._y+=grav;
    }else{
        grav=0;
    }
    if(_root.ground.hitTest(_x,_y,true)) {
        touchingGround=true;
    } else {
        touchingGround=false;
    }

```

it says there is a problem with the first line and the closing bracket.

also i got a problem with the x and y coordinates, i have a frame that does not match the other ones even though the xy numbers are the same.
