# Variable trouble for autommated image gallery

**URL:** <https://forum.kirupa.com/t/variable-trouble-for-autommated-image-gallery/64501>\
**Category:** Uncategorized\
**Created:** [September 16, 2004, 11:23pm UTC](https://forum.kirupa.com/t/variable-trouble-for-autommated-image-gallery/64501 "2004-09-16T23:23:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaboy](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@Jaboy](https://forum.kirupa.com/u/Jaboy)\
**Post date:** [September 16, 2004, 11:23pm UTC](https://forum.kirupa.com/t/variable-trouble-for-autommated-image-gallery/64501/1 "2004-09-16T23:23:01Z")

</div>

I am having a really hard time trying to set the following variable.

i have a bunch of loaded variables via an ASP page. It outputs the filenames of the number of files kept in the ‘images’ folder at the time the page is loaded.  
it outputs the filenames setting each variable with the names:

image1=xxx.jpg&image2=xyz.jpg&image3=jkl.jpg.

i have successfully created buttons corresponding to the number of images conatined in my folder. I now need to figure out how i can set

[size=5][size=4]photo = myData.image+i[/size] [/size](this is value of the filename of my image)  
[size=5][/size]  
[size=3]this is for use in the same loop which creates buttons automatically.[/size]  
[size=3][/size]  
[size=3]The idea is that if it loops through the values of image1 etc the value, which is the full name of the file will be addedaccordingly.[/size]  
[size=3][/size]  
[size=3]here is my code :[/size]  
[size=3][/size]  
[size=3][/size]  
[size=3]myData = new LoadVars();[/size]  
[size=3]  
myData.onLoad = function() {  
[/size]  
[size=3][/size]  
[size=3][/size]  
[size=3][/size]  
[size=3][/size]  
[size=3]

image5.text= myData.image5;  
filepath = “[http://123.123.123/FLASHASP/images/](http://123.123.123/FLASHASP/images/)”;  
numButtons = myData.imagecount;  
X = 10;  
Y = 10;  
for (i=1; i\<=numButtons; ++i) {

\_root.attachMovie(“button”, “button”+i, i);  
buttons\* = \_root[“button”+i];  
\_root[“button”+i].index = i;  
\_root[“button”+i].num = i;  
\_root[“button”+i].\_x = (i\*X)_4;  
\_root[“button”+i].\_y = 20;  
\_root[“button”+i].onPress = function () {  
\_root.createEmptyMovieClip(“container”,300);  
[size=3][color=red][size=4][color=red]mydatavalue = myData.image+_;[size=2][color=#000000] [/color][/size][/color][/size][/color][/size]  
[size=3][color=red][size=4][color=red]container.loadMovie(filepath+mydatavalue, “container”);[/color][/size]  
[/color][/size]container.\_x =200;  
container.\_y = 50;  
}  
}  
}

myData.load(“default.asp”);

[size=4][color=red]If Anyone can help out here, I will be very greatful and will definitely shar the fruits when i turn it into a component!!![/color][/size]  
[/size]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 17, 2004, 12:05am UTC](https://forum.kirupa.com/t/variable-trouble-for-autommated-image-gallery/64501/2 "2004-09-17T00:05:24Z")

</div>

This IS a truly automated ScripT!!

no need for image01 naming of files…

Perfect for enduser updates!!!

Thats the idea here.  
I can do with image01.jpg, image02.jpg

I need to add that file naming convention, then remove it to load the jpg without telling my client to name all his images 01, 02 etc, and then having to keep a list of them aLL

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 17, 2004, 5:38pm UTC](https://forum.kirupa.com/t/variable-trouble-for-autommated-image-gallery/64501/3 "2004-09-17T17:38:58Z")

</div>

is my idea just no good? , or is anyone else in the dark about this as well  
PLease comment.

Thx
