In almost every Flash project, there are thumbnails or icons that need to be created and which then will either load video or image on click event. In a recent project, I had to create thumbnails dynamcially and center align them on stage, based on XML elements, but you can also load them from an Array.
In the following ActionScript 3.0 code, I have defined images in an array, although yuo can load these values from an XML doc too and populate them in this Array. Then there’s a Container MovieClip that holds all the thumbnails which are created dynamcially and images are loaded in the nested UILoader component in each thumbnail movieclip.
Finally, the container MovieClip is placed on the center of stage. I have added comments in the code to explain it further.
//define the thumbnails images in thumbsArray
//you may want to load and parse them from XML document
var thumbsArray:Array = new Array(‘image1.jpg’, ‘image2.jpg’, ‘image3.jpg’, ‘image4.jpg’, ‘image5.jpg’);
var nextX:int = 25;
//create container to hold the dynamically created nested thumbClips
var containerClip:container = new container();
for (i=0; i
Hope that helps.