# While Loop Not Working

**URL:** <https://forum.kirupa.com/t/while-loop-not-working/264550>\
**Category:** flash\
**Created:** [June 27, 2008, 2:24am UTC](https://forum.kirupa.com/t/while-loop-not-working/264550 "2008-06-27T02:24:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thefox14](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Thefox14](https://forum.kirupa.com/u/Thefox14)\
**Post date:** [June 27, 2008, 2:24am UTC](https://forum.kirupa.com/t/while-loop-not-working/264550/1 "2008-06-27T02:24:42Z")

</div>

What my while loop is doing:  
I heard a neat way to make sure the character never goes into the ground by using a while loop. So what it comes down to is that when I get close enough to the ground, my while loop lowers my character 1 pixel at a time. Thus an almost perfect hitTest. But for some reason my while loop is running at the speed of an if() loop (so my character looks as if he’s getting lowered very slowly). If anyone could try to help me fix this it would very much appreciated.

The file:  
[http://spamtheweb.com/ul/upload/260608/76305\_box\_engine28~vers8.fla](http://spamtheweb.com/ul/upload/260608/76305_box_engine28%7Evers8.fla)

The file is commented as well as I could. The two functions that are causing the problem are the very first two you see

If you need any more details just tell me and i’ll do the best I can. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Thefox14](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Thefox14](https://forum.kirupa.com/u/Thefox14)\
**Post date:** [June 27, 2008, 6:49pm UTC](https://forum.kirupa.com/t/while-loop-not-working/264550/2 "2008-06-27T18:49:44Z")

</div>

Looks like that url isn’t working, here’s the file though
