# hitTest & for - speed problem

**URL:** https://forum.kirupa.com/t/hittest-for-speed-problem/194877
**Category:** flash
**Created:** [July 26, 2006, 10:00pm UTC](https://forum.kirupa.com/t/hittest-for-speed-problem/194877 "2006-07-26T22:00:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jasonoda](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jasonoda](https://forum.kirupa.com/u/jasonoda)
#### Post date: [July 26, 2006, 10:00pm UTC](https://forum.kirupa.com/t/hittest-for-speed-problem/194877/1 "2006-07-26T22:00:15Z")

</div>

I am building something where I need to do this:

[http://www.starvingeyes.com/pepsijazz/add6.html](http://www.starvingeyes.com/pepsijazz/add6.html)

The lines are drawn using curveTo code and will eventually wave all over the place. The bottome line, is actually a fill with the alpha set to 0. In order to get the notes that fly along to hug the bottom line. I do something like this:

```auto

name.startyy = 600;
for (yy=name.startyy, go=true; yy>200 & go == true; yy -= 1) {
    xx = name._x;
        if (root.line1.hitTest(xx, yy, true)) {
            name._y = yy
            go = false;
        }
    }

```

The problem is that when I have to many notes on screen at the same time doing this code, it slows down. Is there a way to figure out where the notes should go that will make the movie run faster?

PLEASE VISIT LINK ABOVE BEFORE RESPONDING.

Thank you!
