Using Flash For Loop "i" in Javascript?

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!!!

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')");
}
}