# Loading Jpg, with variables

**URL:** <https://forum.kirupa.com/t/loading-jpg-with-variables/34393>\
**Category:** flash\
**Created:** [November 1, 2003, 3:02pm UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393 "2003-11-01T15:02:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![quik](https://avatars.discourse-cdn.com/v4/letter/q/e19b73/32.png) [@quik](https://forum.kirupa.com/u/quik)\
**Post date:** [November 1, 2003, 3:02pm UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393/1 "2003-11-01T15:02:41Z")

</div>

Okay, trying to make this load certain jpg files based on a variable, but I can’t make it loop through?

[AS]  
artistName = “Grace Jones”;

for(i=1; i\<4; i++){  
filename = artistName+"/"+i+".jpg";  
trace(filename);  
loadMovie(""+artistName+"/2.jpg", _root.images); //this works  
loadMovie(""+filename+"", images.holder_+i); //this does not  
trace(artistName+"/2.jpg");  
}  
[/AS]

any ideas?

---

<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:** [November 1, 2003, 3:06pm UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393/2 "2003-11-01T15:06:07Z")

</div>

oh and I’m trying to put them each on a different frame… any ideas there?

thats the idea of holder\_1, 2, 3… to make a holder for it to load into?

---

<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:** [November 1, 2003, 3:10pm UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393/3 "2003-11-01T15:10:45Z")

</div>

is it also possible to load a jpg to a frame inside a movie clip?

that way I can dynamically have the amount of images create the frames?

---

<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:** [November 1, 2003, 4:14pm UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393/4 "2003-11-01T16:14:32Z")

</div>

What exactly are you trying to laod in what ? Because there are artistname and filename and images and imageholder 1 2 3 4 … I’m getting confused.

---

<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:** [November 3, 2003, 3:01am UTC](https://forum.kirupa.com/t/loading-jpg-with-variables/34393/5 "2003-11-03T03:01:38Z")

</div>

artistName = “Grace Jones”;

for(i=1; i\<4; i++){  
filename = artistName+"/"+i+".jpg";  
trace(filename);  
loadMovie( filename, _root.image["holder_"+i]); //This should work now  
trace(artistName+"/2.jpg");  
}

I think that will do what you need now
