# Appending variable to MCL Object within a class

**URL:** <https://forum.kirupa.com/t/appending-variable-to-mcl-object-within-a-class/293794>\
**Category:** flash\
**Created:** [August 4, 2009, 2:17am UTC](https://forum.kirupa.com/t/appending-variable-to-mcl-object-within-a-class/293794 "2009-08-04T02:17:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk8er5960](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@sk8er5960](https://forum.kirupa.com/u/sk8er5960)\
**Post date:** [August 4, 2009, 2:17am UTC](https://forum.kirupa.com/t/appending-variable-to-mcl-object-within-a-class/293794/1 "2009-08-04T02:17:08Z")

</div>

So i’m trying to build a dynamic gallery class where each thumbnail has it’s own preloader, using the MovieClipLoader(). I’m making it so i can pull all the gallery img paths from a php page that spits it all out as a string seperated by `and then splits the string by ("`") to create my array. This is what I started with:

[//galleryClass.as](https://galleryClass.as)  
class GalleryClass {  
function GalleryClass(galleryRaw){  
galleryRaw = “test.jpg`test2.jpg`test3.jpg`" galleryArr =new Array(); galleryArr = gallerRaw.split("`”);  
}  
for (i=0;i\<galleryArr.length;i++) {  
var this[“thumbMCL”+i] = new MovieClipLoader();  
var this[“thumbList”+i] = new Object();  
this[“thumbMCL”+i].addListener(this[“thumbList”+i]);  
this[“thumbMCL”+i].loadClip(galleryArr\*, “targetMC”);  
this[“thumbMCL”+i].onLoadProgress = function() {  
//preloader actions  
}  
}  
}

Bassically i’m trying to create a unique MCL object and Listnere for each gallery item.  
anybody know how to do what I’m trying to do? Or know a more intuitive way to do this?
