# For Loop Problem - dynamic count limiter

**URL:** <https://forum.kirupa.com/t/for-loop-problem-dynamic-count-limiter/292659>\
**Category:** flash\
**Created:** [July 17, 2009, 5:59am UTC](https://forum.kirupa.com/t/for-loop-problem-dynamic-count-limiter/292659 "2009-07-17T05:59:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MicahZ](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@MicahZ](https://forum.kirupa.com/u/MicahZ)\
**Post date:** [July 17, 2009, 5:59am UTC](https://forum.kirupa.com/t/for-loop-problem-dynamic-count-limiter/292659/1 "2009-07-17T05:59:09Z")

</div>

I’m loading a variable from a .txt file into flash (per client request).  
The variable is as follows…  
&ClientNumberOf=4

so the variable = 4, this works on trace, happy, joy

When I try and add the variable to my for loop…

for (i=1;i\<ClientNumberOf;i++){

Nothing happens.  
Flash should see it as…  
for (i=1;i\<4;i++){

I’ve tried a slew of different options…  
(for example)  
var newVariable:Number = ClientNumberOf;

Nothing works, again, trace works, but script fails to work when I try and dynamically set the loop?!

Thanks.

z
