My account
Shopping cart
Knowledge base
Support


Usage and Code Samples for Thumbnail List Flash Component


Home

Thumbnail List Usage and Code Samples

// matr object that will be assigned to the matrix property
// of the ThumbnailList component
var matr:Object = new Object({lines:4, columns:6});

this.attachMovie("ThumbnailList", "matrix_mc", this.getNextHighestDepth());

// set some of the properties of the component
matrix_mc.keepScrollButtonSize = true;
matrix_mc.matrix = matr;
matrix_mc.setSize(300, 300);
matrix_mc.displayEffect = "fade in";
matrix_mc.rollOverEffect = "black&white";
matrix_mc.backgroundColor = 0x000000;
matrix_mc.preloader = "circle";
matrix_mc.preloaderColor = 0xFFFF00;
matrix_mc.thumbBorderSize = 5;
matrix_mc.thumbBorderCornerRadius = 5;
matrix_mc.thumbBorderColor = 0xFFFFFF;
matrix_mc.thumbWidth = 100;
matrix_mc.thumbHeight = 100;
matrix_mc.thumbSpacing = 5;
matrix_mc.remainActiveOnPress = true;

// load the xml file and display the thumbs
matrix_mc.load("dataXML.xml");

var listener:Object = new Object();

listener.onPressThumb = function(xmlNode:Object, thumb:MovieClip, clipIndex:Number):Void {
         loader_mc.contentPath = xmlNode.thumbnail;
         trace("symbol or image file: "+xmlNode.thumbnail);
         trace("the corresponding large image: "+xmlNode.large);
         trace("image description: "+xmlNode.description);
         trace("the thumbnail that triggered the event: "+thumb);
         trace("the index of the thumb: "+clipIndex);
}

listener.onSlideshowChange = function(xmlNode:Object, thumb:MovieClip, clipIndex:Number):Void {
         loader_mc.contentPath = xmlNode.thumbnail;
         trace("symbol or image file: "+xmlNode.thumbnail);
         trace("the corresponding large image: "+xmlNode.large);
         trace("image description: "+xmlNode.description);
         trace("the thumbnail that triggered the event: "+thumb);
         trace("the index of the thumb: "+clipIndex);
}

matrix_mc.addListener(listener);