# Using Flash For Loop "i" in Javascript?

**URL:** <https://forum.kirupa.com/t/using-flash-for-loop-i-in-javascript/222645>\
**Category:** flash\
**Created:** [April 15, 2007, 7:47pm UTC](https://forum.kirupa.com/t/using-flash-for-loop-i-in-javascript/222645 "2007-04-15T19:47:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lacohido](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@lacohido](https://forum.kirupa.com/u/lacohido)\
**Post date:** [April 15, 2007, 7:47pm UTC](https://forum.kirupa.com/t/using-flash-for-loop-i-in-javascript/222645/1 "2007-04-15T19:47:00Z")

</div>

hi there-  
Im creating a multiple buttons in flash using a For Loop and AttachMovie. These buttons will launch a Javascript popup window (See Code Below). Is there a way to use the For Loop “i” whithin the javascript? I dont think the way I have it written now will work. Suggestions??? Thanks!!!

```auto
for (i=0; i<26; i++) {
	var t = this.attachMovie("thumb","thumb"+i, i);
	t._x = (i * 200)-2400;
	t._y = 0;
	//t._xscale = 200;
	//t._yscale = 100;
	t.tmbLoader.loadMovie((i+1)+".jpg");
	t.onPress = function() {
	getURL ("javascript:launch (i+'.html')");
}
}

```
