Class bgswitcher.ThumbList

Description

This is the thumb list class for the application. It actually forms the content_mc movieclip of MouseScrollBox class used in this file. The scrollbox helps to scroll through the thumbnails items.

The following events are dispatched by this class:

ThumbClicked - dispatched when the a thumb is clicked. The loadObj property of the event object has all the datails required to load the right image when a thumbnails is clicked. The image is retrieved as loadObj.img, the thumbnail as loadObj.thumb and the number of the thumbnail as loadObj.num.

ThumbListInit - dispatched afer the initialization of the list

Field Index

colNum, scrollDirection, thumbGap, thumbHeight, thumbWidth, totalThumbs

Method Index

new ThumbList()
addEventListener(), imgPath(), init(), registerListener(), removeEventListener()

Constructor Detail

ThumbList

public function ThumbList()

Field Detail

thumbWidth

public thumbWidth:Number [Read Only]
Use this property to get the width of the thumbnail. It is set when the gallery xml file is parsed. This property is used by Thumb class to align and scale the thumbnails properly.

thumbGap

public thumbGap:Number [Read Only]
Use this property to get the gap between thumbnails alignments. It is set when the gallery xml file is parsed. This property is used by Thumb class to align and scale the thumbnails properly.

thumbHeight

public thumbHeight:Number [Read Only]
Use this property to get the height of the thumbnail. It is set when the gallery xml file is parsed. This property is used by Thumb class to align and scale the thumbnails properly

colNum

public colNum:Number [Read Only]
Use this method to get the number of columns of thumbnails the list has

totalThumbs

public totalThumbs:Number [Read Only]
Use this method to get the total number of thumbnails

scrollDirection

public scrollDirection:String [Read Only]

Method Detail

init

public function init(arr:Array, width:Number, height:Number, gap:Number, col:Number, dir:String)

Function called to initialize the list

Parameters

arr- array containing the paths to thumbnail images
width- width of the thumbnail
height- height of the thumbnail
gap- gap between the thumbnails
col- the number of columns
dir- the direction of scrolling

registerListener

public function registerListener(mc:MovieClip)

Use this method to register any movieclip as a listener to this class' events

Parameters

mc- the movieclip that is to be registered

imgPath

public function imgPath(i:Number):String

Use this function to get the path of the image to be loaded for a particular thumbnail

Parameters

i- the number of the thumbnail

Return

- the path of the image

addEventListener

public function addEventListener()

removeEventListener

public function removeEventListener()