Eddie3D
07-26-2009, 07:54 PM
Hi
I'm relatively new to actionscript and am struggling with the following.
I've created a little image gallery which loads image paths as variables from a text file using loadVariablesNum. The variables are named image1, image2, image3 etc, I'd like to use a for loop to store each of these in an array. I thought I could use something like the following but I can't get it to work.
var myImages:Array new Array(numofimages)
for( i=0; i= numofimages; i++) {
myImages(i) = eval("image"+i)
};
I think the eval function is no longer valid in AS3, I've tried various options like myImages(i) = this["image"+i]
but I'm struggling to find a solution.
Any help would be appreciated.
Thanks
I'm relatively new to actionscript and am struggling with the following.
I've created a little image gallery which loads image paths as variables from a text file using loadVariablesNum. The variables are named image1, image2, image3 etc, I'd like to use a for loop to store each of these in an array. I thought I could use something like the following but I can't get it to work.
var myImages:Array new Array(numofimages)
for( i=0; i= numofimages; i++) {
myImages(i) = eval("image"+i)
};
I think the eval function is no longer valid in AS3, I've tried various options like myImages(i) = this["image"+i]
but I'm struggling to find a solution.
Any help would be appreciated.
Thanks