AS problem.
- Started
- Last post
- 10 Responses
- nosaj
I have these variables:
image1 = "one.jpg";
image2 = "two.jpg";
image3 = "three.jpg";I want to be able to set the image to load by setting a variable named number to be equal to the image to load then concatinating the sting ie
number=1
imagetoload = ("image"+number);I'm looking for the result image1 so I can then load the results of image1 - this being one.jpg. Problem is I can't seem to get ("image"+number); to work... Any suggestions?
- ozhanlion0
errr
how come "image"+number
- richsteph0
Try an array instead
images = new Array("one.jpg", "two.jpg", "three.jpg");
number=0;
imagetoload = (images[number]); //loads one.jpg
- nosaj0
The image names are pulled from an XML doc that will have a changing number of photos. I need to be able to dynamically load the photo's into a movie clip (kind of like a slide show running in a loop).
So the clip loads the value of image1, then 10 seconds later the value of image2 etc... I want it to stop when it hits the end of the list which is generated by counting the items in the XML file. if I can kee the number at the end of image dynmic I can compair it to the number od the items in the XML file and then stop when they are equal to each other... IF that makes sense.
- richsteph0
Check your email. Have sent .fla. You will need to do a setInterval timer to change the images though. Let me know how you get on.
- spent20000
richsteph,
can i see that fla as well. i am curious about somemthing. I had to do this recently too
- richsteph0
On it's way..
- Anarchitect0
why can't you compare that number whit you xml chidlnodes.length?
- nosaj0
Her's a very simplfied example of what I'm trying to do:
image1 = one.jpg;
count = 1;
imagetoload = ("image"+count);
loadMovie(imagetoload, "here");I believe the problem lies in this line:
imagetoload =("image"+count);
This need to return image1 so I can pull the value one.jpg from it.
- nosaj0
This might be a little more clear:
image1 = "images/one.jpg";
nameme = "image";
added = nameme+1;I need the value of added to be "images/one.jpg" but the result I get is "image1".
- nosaj0
eval