# Looping through external variables \[AS 2\]

**URL:** <https://forum.kirupa.com/t/looping-through-external-variables-as-2/227622>\
**Category:** flash\
**Created:** [May 31, 2007, 8:15pm UTC](https://forum.kirupa.com/t/looping-through-external-variables-as-2/227622 "2007-05-31T20:15:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatbigbrain](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@greatbigbrain](https://forum.kirupa.com/u/greatbigbrain)\
**Post date:** [May 31, 2007, 8:15pm UTC](https://forum.kirupa.com/t/looping-through-external-variables-as-2/227622/1 "2007-05-31T20:15:15Z")

</div>

Hey peeps,  
I’m going bananas over here! Please help!  
I’m using LoadVars (results\_lv below) to load variables from an ASP page, returned as follows:  
option1=4&option2=5&option3=32&option4=… etc. etc.

There are a different number of “options” returned each time, depending on the query sent to the script. I have access to the number of options ahead of time, but still don’t know how to loop through them…

So… How on earth do I loop through these variables?!?  
Basically I’d be thrilled to be able to do this:

trace(results\_lv.option1);  
trace(results\_lv.option2);  
trace(results\_lv.option3);

and so on, until they’ve all been traced.

Thanks in advance to anyone who can help me.  
Steve
