# As3 variables and looping help

**URL:** <https://forum.kirupa.com/t/as3-variables-and-looping-help/324989>\
**Category:** flash\
**Created:** [September 20, 2011, 9:57am UTC](https://forum.kirupa.com/t/as3-variables-and-looping-help/324989 "2011-09-20T09:57:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevetheElk](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@StevetheElk](https://forum.kirupa.com/u/StevetheElk)\
**Post date:** [September 20, 2011, 9:57am UTC](https://forum.kirupa.com/t/as3-variables-and-looping-help/324989/1 "2011-09-20T09:57:12Z")

</div>

Hi All

I’ve got a question that is probably really easy if you know the answer (aren’t they all).  
I have a series of text boxes with instance names of

home1  
hs1  
as1  
away1

home2  
hs2  
as2  
away2… etc etc

I then want to populate these from a loop, similar to follows:

for (i=0; i \< 9; i++){

```
	home i= match.scores.item.fixtures.item*.hometeam;
	hs i.text = match.scores.item.fixtures.item*.homescore;
	as i.text = match.scores.item.fixtures.item*.awayscore;
	away i.text = match.scores.item.fixtures.item*.awayteam;
	
	}

```

but cant seem to get the code to work…  
I’ve tried

home\* but i can’t use [] in instance names  
home"+i" etc all seems to not do the job…  
any thoughts?

Thanks in advance!
