# Dynamically loaded pictures + buttons

**URL:** <https://forum.kirupa.com/t/dynamically-loaded-pictures-buttons/46358>\
**Category:** flash\
**Created:** [March 23, 2004, 7:37pm UTC](https://forum.kirupa.com/t/dynamically-loaded-pictures-buttons/46358 "2004-03-23T19:37:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nipp2002](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nipp2002](https://forum.kirupa.com/u/nipp2002)\
**Post date:** [March 23, 2004, 7:37pm UTC](https://forum.kirupa.com/t/dynamically-loaded-pictures-buttons/46358/1 "2004-03-23T19:37:31Z")

</div>

I am having 2 problems with the following code…

[AS]

picNamesA = [“pic1”,“pic2”,“pic3”,“pic4”,“pic5”,“pic6”];  
picNamesB = [“pic7”,“pic8”,“pic9”,“pic10”,“pic11”,“pic12”];

picsDir = “[http://www.totoffroadandperformance.com/pics/](http://www.totoffroadandperformance.com/pics/)”;  
pic1();

function pic1() {  
for(i=0; i\<picNamesA.length; i++) {  
mc = this.createEmptyMovieClip(“container”+i, i);  
mc.\_y = 20;  
mc.\_x = i_90;  
loadMovie(picNamesA_+".jpg", “container”+i);  
}  
for(i=0; i\<picNamesA.length; i++) {  
mcbutton = this.attachMovie(“hidden”, “hidden”+i, i+picNamesA.length);  
mcbutton.\_y = 20;  
mcbutton.\_x = i_90;  
mcbutton.onRelease = function() {  
trace(picNamesA_);  
getURL(picsDir+picNamesA\*+".jpg", \_blank);  
}  
}  
}  
[/AS]

Ok First problem the pics load but the second FOR loop the buttons don’t position themselves correctly. Second problem was in the getURL() It doesnt seem to read the variable picNamesA\*, I did a trace as you can see and it outputs “undefined”. Any help would be appreciated. :sketchy:
