# While loop problem

**URL:** <https://forum.kirupa.com/t/while-loop-problem/268588>\
**Category:** Uncategorized\
**Created:** [August 15, 2008, 3:15pm UTC](https://forum.kirupa.com/t/while-loop-problem/268588 "2008-08-15T15:15:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricmar](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@Ricmar](https://forum.kirupa.com/u/Ricmar)\
**Post date:** [August 15, 2008, 3:15pm UTC](https://forum.kirupa.com/t/while-loop-problem/268588/1 "2008-08-15T15:15:05Z")

</div>

Wonder if someone more experienced could help. When i run this flash file the movies freezes. Its specifically when i click the button that activates this function. I dont think its a never ending loop. Having changed a few things around I know for sure this code is the prob

function calculateScore() {  
var i:Number = 0;  
while (i \< dealerScoreArray.length) {  
trace("SCORE " + i);  
}  
}

Any ideas whats wrong? the dealerScoreArray always has an item pushed into it before this function is called so will have at least 1 in length

Thanks if anyone can help
