# HitTest Heaven.....not!

**URL:** <https://forum.kirupa.com/t/hittest-heaven-not/232432>\
**Category:** flash\
**Created:** [July 13, 2007, 5:19pm UTC](https://forum.kirupa.com/t/hittest-heaven-not/232432 "2007-07-13T17:19:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikomax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nikomax/32/3664_2.png) [@nikomax](https://forum.kirupa.com/u/nikomax)\
**Post date:** [July 13, 2007, 5:19pm UTC](https://forum.kirupa.com/t/hittest-heaven-not/232432/1 "2007-07-13T17:19:40Z")

</div>

Hi  
I have this code…

```php

function CreateFood() {
    for (i=0; i<_root.food; i++) {
        moreFood = attachMovie("food", "food"+i, i+1);
        with (moreFood) {
            _x = random(Math.floor(530))+25;
            _y = random(Math.floor(370))+25;
            this.onEnterFrame = function() {
                if (this.hitTest(_root.circle)) {
                    _root.score+5;
                }
            };
        }
    }
}

```

…and its meant to make 5 copies of the MC food with the onEnterFrame function to make it continually watch to see if it it touched by the MC circle and increase score by 5, now no matter how much i change the way the hitTest is written it will not increase my score var  
So what can I do ?  
P.S  
I just changed \_root.score+5 to \_root.score = \_root.score+5 and it continually went up in fives:puzzle: what do i do ?!?!?!
