# Dynamic image naming

**URL:** <https://forum.kirupa.com/t/dynamic-image-naming/28951>\
**Category:** flash\
**Created:** [August 20, 2003, 1:44pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951 "2003-08-20T13:44:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![capt\_ace](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@capt\_ace](https://forum.kirupa.com/u/capt_ace)\
**Post date:** [August 20, 2003, 1:44pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951/1 "2003-08-20T13:44:54Z")

</div>

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.

[COLOR=royalblue]container.loadMovie("/images/photo.jpg");[/COLOR]

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

---

<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:** [August 20, 2003, 1:49pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951/2 "2003-08-20T13:49:35Z")

</div>

```auto

container.loadMovie("/images/"+image_file_name+".jpg"); 

```

---

<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:** [August 20, 2003, 2:26pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951/3 "2003-08-20T14:26:53Z")

</div>

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

---

<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:** [August 20, 2003, 3:12pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951/4 "2003-08-20T15:12:50Z")

</div>

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

---

<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:** [August 20, 2003, 3:28pm UTC](https://forum.kirupa.com/t/dynamic-image-naming/28951/5 "2003-08-20T15:28:06Z")

</div>

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,
