Click to See Complete Forum and Search --> : adding number variable to string


blinkerton
03-28-2007, 05:29 AM
I am trying to use a for loop to create MovieClips, move them over, then load a thumbnail image, but can't seem to get the correct syntax for adding a number variable to a string. ("currentNode" is from XML). Any thoughts?

Thanks


function populateGallery(currentNode)
{
for(x = 0; x < horizonal_dimension * number_of_pics ; x += horizonal_dimension)
{
this.createEmptyMovieClip("dynThumb" + pic_number, pic_number);
"dynThumb" + pic_number._x = horizonal_dimension;

imagePath = currentNode.attributes.jpegURL;
dynThumb + pic_number.loadMovie(imagePath);
currentNode = currentNode.nextSibling;
pic_number++;
}
}

blinkerton
03-29-2007, 02:27 PM
nevermind, i figured it out:


for(var pic_number = 1; pic_number < number_of_pics ; pic_number++)
{
var thisMC:MovieClip = this.createEmptyMovieClip("dynThumb"+pic_number+"_mc", pic_number);
}