PDA

View Full Version : Dynamic image naming



capt.ace
August 20th, 2003, 09:44 AM
I'm writing a full flash image achive that holds way too many photos for a static site. I'm using the code below to dynamically load the images.

container.loadMovie("/images/photo.jpg");

I've managed to get most of it done (Thanks to everyone who gave me a nudge here and a pointer there), but My lack of flash syntax is hampering my progress.

My movie also connects to a db and gets variables for "image_file_name" among other things.

How do I replace photo.jpg with the variable "image_file_name".jpg

Hold those laughs back...

Ta
Capt

λ
August 20th, 2003, 09:49 AM
container.loadMovie("/images/"+image_file_name+".jpg");

capt.ace
August 20th, 2003, 10:26 AM
I can't seem to get that to work

container.loadMovie("/img/article/250x250/nonprog/"+imgf+".jpg");
Not Working

I've replaced the dynamic code with the static file name

container.loadMovie("/img/article/250x250/nonprog/000056_00007.jpg");
Working

I've also displayed the file name as dynamic text, just to check that the variable is working



Very odd?

Flash MX : BTW

and of course, thanks

robocop
August 20th, 2003, 11:12 AM
Have you thought about creating an XML file to store the image names/locations....then having flash loop through the XML file to load the images in?...that way, you could just edit the XML file to add more images.....


:bu: :bu:
kc

capt.ace
August 20th, 2003, 11:28 AM
XML is a bit over my head at the moment, but I will bare it in mind for the future.....

Any idea why my orignal problem doesn't work?

Capt,