ThumbGallery Template Tutorial
ThumbGallery Component Tutorial
Adding the gallery to Myspace.com
Customizing ThumbGallery in the Component Inspector
Customizing ThumbGallery using XML
How to add captions to a gallery
Customizing the loading animation
Setting Properties with Actionscript
Actionscript Methods
Actionscript Events
Requirements



ThumbGallery Template Tutorial
 


The ThumbGallery Template includes all you need to create a stand-alone gallery or a gallery to add to your html pages. You do not need the Flash application to use the ThumbGallery Template.

Step 1- Create your images
Create two JPGs for each image - one sized for the thumbnail and one sized for the main image. These images can be any dimension. Add these JPGs to the images folder. Make sure the JPGs are saved as non-progressive JPGs.

Step 2- Populate the XML file
The XML file is a simple text file that tells ThumbGallery where the images are and in what order to display them. It is also used to customize the look of the gallery. The Template includes an XML file named "gallery_data.xml" for you to update. The XML structure looks like this:

 

<gallery>
       <!--The line below defines the path to the folder where your images are-->
       <setup path="images/" >
              <!--The lines below are used to edit and add properties to change the look of the gallery-->
              <imgWidth>500</imgWidth>
              
<imgHeight>400</imgHeight>
              <thumbWidth>50</thumbWidth>

              <thumbHeight>50</thumbHeight>
              <transitionType>wipe</transitionType>
             <thumbnailRows>2</thumbnailRows>
       </setup>
       <!--The following lines are where you set the names of images and thumbnails -->
       <item>
              <thumb>thumb1.jpg</thumb>
              <img>image1.jpg</img>
        </item>
        <item>
              <thumb>thumb2.jpg</thumb>
              <img>image2.jpg</img>
        </item>
</gallery>

Within the <setup> node you can add many properties to change the look of the gallery. A full list can be found here. Each image you have in your gallery is defined in the <item> node. This is where you type in the name of the main image and thumbnail image. There is no limit to the number of images in a gallery.

Step 3- Test and load to your web site
Test your gallery by opening the gallery.html file in a browser. Then upload the following files to your web server: gallery.swf, gallery.html, gallery_data.xml, swfobject.js and the images folder. - you're done!

ThumbGallery Component Tutorial
 


Use the ThumbGallery Component to add a gallery inside your Flash files. The download comes with sample Flash files to further show how galleries can be set up.

Step 1- Set up the ThumbGallery Component in Flash
In Flash, drag an instance of the ThumbGallery component to the stage.
In the Flash menu, select: Window > Development Panels > Component Inspector.
(or if using Flash 8 select: Window > Component Inspector.)
The component inspector is where you customize your gallery. Find the property named "XML path", enter the location of you XML file. In this case enter: "gallery.xml"
Next, enter values for the following: Image Height, Image Width, Thumb Height, ThumbWidth.
These values should match the pixel size of the JPGs you created earlier. Lastly, enter any other
values that you would like to customize.

Next follow the three steps outlined in "ThumbGallery Template Tutorial" above. Go there now
Note: any properties you define in the XML file will override properties you define in component Inspector.
Using the XML file to define your properties is any easy way to customize your gallery without having to republish the Flash file.


Adding the gallery to Myspace.com
 


1) First follow the steps from the Template tutorial above. In the XML file where you set the image folder path, enter the full url to where you will upload the images. Example: <setup path="http://www.mysite.com/images/">

2) Then upload the SWF file, JPGs folder and XML file to an external webhost such as geocities, or a web host where you host another website.

3) After you have uploaded the files add the following code to any of the sections in your Myspace profile:

<embed allowScriptAccess="never" allowNetworking="internal" enableJSURL="false" enableHREF="false" saveEmbedTags="true" src="http://www.flashrelief.com/gallery.swf?xmlPath=http://www.flashrelief.com/gallery_data.xml" " quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"
width="800"
height="600">
</embed>

3)Replace http://www.flashrelief.com/gallery.swf with your own path to the SWF file

4)Replace http://www.flashrelief.com/gallery_data.xml with your own path to the XML file


5)Save the settings and you are done!


Customizing ThumbGallery using the Component Inspector
 


You can customize the ThumbGallery Component using the Component Inspector. To find the Component Inspector in Flash go to the menu: Window > Development panels > Component Inspector or if using Flash 8 select: Window > Component Inspector.

The following is a list of all the properties you can change in the Component Inspector.

Parameter sample value Description
Image Height 250 height of the main image (jpg)
Image Width 400 width of the main large image (jpg)
Thumb Height 30 height of a thumbnail (jpg)
Thumb Width 35 width of a thumbnail (jpg)
thumbType images Changes the style of thumbnail to be displayed. Valid values are: "images", "numbers" and "solidColor". Default value is "images".
captionText TextField

Defines the location of a TextField where the text captions will be placed. The caption text is defined in an external XML file.

autoPlay 4 number of seconds that an image is displayed while in auto mode
XML Path xml/gallery.xml name and location of the XML file
background alpha 50 Alpha value of the Background rectangle
bgBorderThickness 10 Thickness of the background rectangles edge
Color - Background #FF0000 Color of the background rectangle
Color - Thumb Active #333333 Color of the Thumbnail outline once clicked on
Color - Thumb Default #CCCCCC Default color of the Thumbnail outline
Color - Thumb Rollover #FFFFFF Color of the outline when rolling over
Color - imgBgColor #FFFFFF Changes the color of the area behind the main image. This is the area that shows if an image is smaller than what you defined for the properties: imgHeight and imgWidth.
Corner - Background 10 Corner radius of the background rectangle
Corner - Main Image 10 Corner radius on the main image
Corner - Thumbnail 5 Corner radius of the thumbnails
Corner - Thumb Mask 5 Corner radius of the thumbnail Mask. Edges can be seen when thumbs are scrolling on/off screen.
imageCentering center changes the position of the loaded image inside the main image area. Valid values are: "center", "left", "right", "top" "bottom","TL","TR","BL","BR". Default value is "center". This prperty is only relevant if images are smaller in size than what you defined for the properties imgHeight and imgWidth. Changes to this property must precede the creation of the gallery.
numberFont Verdana The font used for the numbers. Default value is "Arial"
numberColor oxFFFFFF

The text color of the numbers. The default value is 0x333333

numberFontSize 16

The font size of the numbers. The default value is 10

numberBold true

Boolean value that indicates if the numbers are bold. The default value is false.

numberEmbedFonts  

A Boolean value that indicates whether the font specified in numberFont is an embedded font. This style must be set to true if numberFont refers to an embedded font. Otherwise, the embedded font will not be used. If this style is set to true and numberFont does not refer to an embedded font, no text will be displayed. The default value is false.

scrollspeed 6 Speed that the thumbnails scroll when rolled over.
Showloader true Defines whether or not to show the loading animation. Default is true
Thumb Spacing 3 Distance in pixels between the thumbnails
thumbnailrows 2 Number off rows of thumbnails to display
thumbOutlineThick 2 Thickness of the outline on the thumbnails
thumbposition left Position of the thumnails relative to the main image area. Options are: left, right, top or bottom
thumbAlpha 50 Alpha percentage of the non-selected thumbnails
thumbCaptionChange true Property that determines if the caption TextField should change when thumbnails are rolled over. If set to true, the caption TextField will show the caption for the thumbnail that is currently rolled over. If set to false, no change will take place in the caption TextField.
thumbToImgSpace 5 The distance between the thumbnails and the main image area
transitionspeed 5 Speed at which the main image will transition to the next image after a thumbnail is clicked .
transitiontype fade Type of transition on the main image when a thumbnail is clicked. select from: fade, zoom, squeeze, pixeldissolve, blinds, wipe, iris, photo or fly
imageCentering center changes the position of the loaded image inside the main image area. Valid values are: "center", "left", "right", "top", "bottom","TL","TR","BL","BR". Default value is "center". This property is only relevant if images are smaller in size than what you defined for the properties imgHeight and imgWidth.
soundThumbRoll roll.wav This property sets the sound that will play when a thumbnail is rolled over. The sound defined must match a sound in the library with the same linkage name. The library sound should also be set to "Export for actionscript" and "Export in first frame" If no sound is defined, no sound will play.
soundThumbClick click.wav This property sets the sound that will play when a thumbnail is clicked on. The sound defined must match a sound in the library with the same linkage name. The library sound should also be set to "Export for actionscript" and "Export in first frame" If no sound is defined, no sound will play.
stopAutoOnClick true Property that changes whether or not to stop the automatic cycling of images after a thumbnail is clicked or after the following methods are called: nextImage() prevImage(). Default value is true.
randomImages true Property that changes whether or not to randomize the order of images displayed. If set to false, the image order will be the order the images are defined in the XML file
loopImages true Property that changes whether or not to loop through the images when the autoPlay feature is on or if browsing images using the method: nextImage()
noCache true Property that changes whether or not the browser will cache the JPGs and XML file. If set to true, the JPGs and XML file will be reloaded from the server and not taken from the browser cache. This is useful if you will frequently change the images shown in the gallery. Default value is false.
scaleToFit true Property that changes whether or not to scale the main images and thumbnails to fit the viewable area. If set to true, and the images are smaller than the viewable area, the images will upscale to fill the space. If the images are larger, they will downscale to fit the space. If images are not the same proportion as the viewable area, cropping will occur.
 
Customizing the gallery using XML
 


You can customize the look of ThumbGallery using the XML file. When using the ThumbGallery Component, any properties you add to the XML file will override properties in the Component Inspector. Add the properties you want to change by adding nodes inside the <setup> node.
Example:

 

<setup path="images/" >
       <!--add any properties you would like to change for the gallery-->
       <imgWidth>500</imgWidth>
       
<imgHeight>400</imgHeight>
       <thumbWidth>50</thumbWidth>

       <thumbHeight>50</thumbHeight>
       <transitionType>wipe</transitionType>
       <thumbnailRows>2</thumbnailRows>
</setup>


The following is a list of all the properties you can add in the XML file.

Parameters with sample values Description
<imgHeight>500</imgHeight> height of the main image area (jpg)
<imgWidth>400</imgWidth> width of the main large image area (jpg)
<thumbHeight>50</thumbHeight > height of a thumbnail (jpg)
<thumbWidth>50</thumbWidth > width of a thumbnail (jpg)
<imgLink>http://www.yahoo.com</imgLink> This will turn the main image into a link that when clicked on will take you to the URL.
<thumbType>number</thumbType> Changes the style of thumbnail to be displayed. Valid values are: "images", "numbers" and "solidColor". Default value is "images".
<autoPlay>5</autoPlay> number of seconds that an image is displayed while in auto mode
<backgroundAlpha>50</backgroundAlpha > Alpha value of the Background rectangle
<bgBorderThickness>5</bgBorderThickness> Thickness of the background rectangles edge
<backgroundColor>#FFFFFF</backgroundColor> Color of the background rectangle
<imgBgColor >#FFFFFF</imgBgColor > Changes the color of the area behind the main image. This is the area that shows if an image is smaller than what you defined for the properties: imgHeight and imgWidth.
<captionTextField>TextFieldName</captionTextField> Defines the location of a TextField where the text captions will be placed. The caption text is defined in an external XML file. This is not applicable if using the stand-alone template.
<thumbActiveColor>#FFFFFF</thumbActiveColor> Color of the Thumbnail outline once clicked on
<numberFont>Arial</numberFont> The font used for the numbers. Default value is "Arial" This is not applicable if using the stand-alone template.
<numberColor>0xFFFFFF</numberColor>

The text color of the numbers. The default value is 0x333333

<numberFontSize>12</numberFontSize>

The font size of the numbers. The default value is 10

<numberBold>true</numberBold>

Boolean value that indicates if the numbers are bold. The default value is false.

<numberEmbedFonts></numberEmbedFonts>

A Boolean value that indicates whether the font specified in numberFont is an embedded font. This style must be set to true if numberFont refers to an embedded font. Otherwise, the embedded font will not be used. If this style is set to true and numberFont does not refer to an embedded font, no text will be displayed. The default value is false. This is not applicable if using the stand-alone template.

<thumbColor>#FFFFFF</thumbColor> Default color of the Thumbnail outline
<thumbRollColor>#FFFFFF</thumbRollColor> Color of the outline when rolling over
<backgroundCorner >5</backgroundCorner > Corner radius of the background rectangle
<imgCorner>5</imgCorner> Corner radius on the main image
<thumbCorner>5</thumbCorner> Corner radius of the thumbnails
<thumbMaskCorner>5</thumbMaskCorner> Corner radius of the thumbnail Mask. Edges can be seen when thumbs are scrolling on/off screen.
<scrollSpeed>8</scrollSpeed> Speed that the thumbnails scroll when rolled over.
<showLoader>true</showLoader> Defines whether or not to show the loading animation. Default is true
<thumbSpace>5</thumbSpace> Distance in pixels between the thumbnails
<thumbnailRows>3</thumbnailRows> Number off rows of thumbnails to display
<thumbAlpha>50</thumbAlpha> Alpha percentage of the non-selected thumbnails
<thumbOutlineThick>2</thumbOutlineThick> Thickness of the outline on the thumbnails
<thumbPosition>left</thumbPosition> Position of the thumnails relative to the main image area. Options are: left, right, top or bottom
<thumbCaptionChange>true</thumbCaptionChange> Property that determines if the caption TextField should change when thumbnails are rolled over. If set to true, the caption TextField will show the caption for the thumbnail that is currently rolled over. If set to false, no change will take place in the caption TextField.
<thumbToImgSpace>12</thumbToImgSpace> The distance between the thumbnails and the main image area
<transitionSpeed>1</transitionSpeed> Speed at which the main image will transition to the next image after a thumbnail is clicked .
<transitionType >fade</transitionType > Type of transition on the main image when a thumbnail is clicked. select from: fade, zoom, squeeze, pixeldissolve, blinds, wipe, iris, photo or fly
<imageCentering>center</imageCentering> Changes the position of the loaded image inside the main image area. Valid values are: "center", "left", "right", "top" or "bottom". Default value is "center". This property is only relevant if images are smaller in size than what you defined for the properties imgHeight and imgWidth.
<soundThumbRoll>roll.wav</soundThumbRoll> This property sets the sound that will play when a thumbnail is rolled over. The sound defined must match a sound in the library with the same linkage name. The library sound should also be set to "Export for actionscript" and "Export in first frame" If no sound is defined, no sound will play. The sound can't be changed when using the stand-alone template but you can turn it off by setting this property to blank..
<soundThumbClick>click.wav</soundThumbClick> This property sets the sound that will play when a thumbnail is clicked on. The sound defined must match a sound in the library with the same linkage name. The library sound should also be set to "Export for actionscript" and "Export in first frame" If no sound is defined, no sound will play. The sound can't be changed when using the stand-alone template but you can turn it off by setting this property to blank..
<stopAutoOnClick>true</stopAutoOnClick> Property that changes whether or not to stop the automatic cycling of images after a thumbnail is clicked or after the following methods are called: nextImage() prevImage(). Default value is true.
<randomImages>true</randomImages> Property that changes whether or not to randomize the order of images displayed. If set to false, the image order will be the order the images are defined in the XML file
<loopImages>true</loopImages> Property that changes whether or not to loop through the images when the autoPlay feature is on or if browsing images using the method: nextImage()
<noCache>true</noCache> Property that changes whether or not the browser will cache the JPGs and XML file. If set to true, the JPGs and XML file will be reloaded from the server and not taken from the browser cache. This is useful if you will frequently change the images shown in the gallery. Default value is false.
<scaleToFit>true</scaleToFit> Property that changes whether or not to scale the main images and thumbnails to fit the viewable area. If set to true, and the images are smaller than the viewable area, the images will upscale to fill the space. If the images are larger, they will downscale to fit the space. If images are not the same proportion as the viewable area, cropping will occur.
<captionPosition>bottom<captionPosition> For the Template only. Sets the location of the caption and next/previous controls. Can either be "top" or "bottom". This is not needed for the component because caption and controls can be placed anywhere manually in Flash.
<showControls>false</showControls> For the Template only. Defines whether or not to display the next/previous/play/pause copntrols. This is not needed for the component because controls can be manually edited.
 
How to add captions to a gallery
 


To add captions to a gallery, the first step is to add caption tags to your XML file. See orange text below.

 

<gallery>
   <!--The line below defines the path to the folder where your images are-->
   <setup path="images/" / >
   <!--The following lines are where you set the names of images and thumbnails -->
   <item>
       <thumb>thumb1.jpg</thumb>
       <img>image1.jpg</img>
        <caption>This is me at the beach!</caption>
   </item>
   <item>
       <thumb>thumb2.jpg</thumb>
       <img>image2.jpg</img>
        <caption>This is me on top of a mountain!</caption>

   </item>
</gallery>


If you're using the Template version you can color and style the text using HTML tags in the XML like this:<caption><![CDATA[<font size="14" color="#FF0000">Text here!</font>]]></caption>

If using the component, in Flash add a TextField on to the Stage. Give the TextField a name like "captionText" Open the Component inspector, find the property named "captionTextField" and enter the path to your TextField. In this case, enter "captionText". If your TextField is inside a MovieClip, enter the full path: for example "mc.captionText".

In the Component Inspector, you can also set the value "thumbCaptionChange" to determine whether or not captions change when thumbnails are rolled over.

Note: A sample gallery with captions is included in the download.


Customizing the loading animation
 


To customize the default loading animation follow these steps below. Note: If using the stand-alone ThumbGallery Template the loading animation cannot be changed, you need to use the ThumbGallery Component to do this.

Step 1:
In the download folder that came with the component there is a folder labeled "custom_loader".
Inside this folder, open the file named "loader.fla". In the library, there is a movieclip named "tg_load_anim". Drag this symbol into the library of the movie that contains your gallery. This replaces the default load animation with a standard bar preloader. This makes the preloader easier to edit.

Double click on the symbol in the library named "tg_load_anim". You will see code on the actions layer that looks like this:

 

function onLoadProgress(percentloaded:Number) {
     mc. bar._xscale = percentloaded
     mc. textField.text = percentloaded
}

The parameter "percentloaded" is updated as new images are loading. In this function you can edit the code to fit your animation. Edit the movieclips to customize your graphics.


Setting properties with actionscript
 


All properties that can be set in the Component Inspector and XML can also be set using actionscript.

A complete list of properties can be found in Flash in the Actions panel at the list on the left hand side. Listed under the directory: FlashRelief>ThumbGallery. They can also be found in the help menu at the top under: Help>Flash Help. Then select: FlashRelief>ThumbGallery

The following example sets properties using actionscript. Note: At the end, you need to call the createGallery() method.

 

myGallery.imgHeight=400
myGallery.imgHeight=400
myGallery.thumbWidth=400
myGallery.tumbWidth=400
myGallery.createGallery("xml.gallery.xml")




 

Actionscript methods
 


ThumbGallery.createGallery()

 

Parameters
url A string that represents the URL where the XML document to be loaded is located. If the SWF file that issues this call is running in a web browser, url must be in the same domain as the SWF file.

Description:
CreateGallery() is used to draw a new gallery based on the information in the XML file. This is useful for example if you want to display different galleries. You could load in different XML files when different buttons are clicked.

Usage:
myGallery.createGallery("gallery.xml")


ThumbGallery.createFromArray(array)

 

Parameters
Array An array of objects which define the path to your images.

Description:
If you would like to define the image paths in actionscript rather than using an XML file, you would use the createFromArray() method and pass it an Array of Objects. Each object must contain an "img" and "thumb" property which define the path to the .jpg's

Usage:
var myArr = new Array()
//store image paths in objects
var ob1 ={img:"images/im1.jpg",thumb:"images/th1.jpg"}
var ob2 ={img:"images/im2.jpg",thumb:"images/th2.jpg"}
//store objects in array
myArr = [ob1, ob2] ;
// create gallery from the array
myThumbGallery.createFromArray(myArr)



ThumbGallery.nextImage()

 

Description:
This method will display the next image that follows the currently selected image. Useful for adding aarrows to navigate through the images.
To display the previous image, use the method: prevImage()


Usage:
myThumbGallery.nextImage()


ThumbGallery.prevImage()

 

Description:
This method will display the image previous to the currently selected image. Useful for adding aarrows to navigate through the images.
To display the next image, use the method: nextImage()


Usage:
myThumbGallery.prevImage()


 

ThumbGallery.loadImage(number)

 

Parameter:
Number: Sets the which image to display. The number is relative to the order that the image appears in the XML file

Description:
This method will display the image number defined in the parameter. This is useful if you want a link(s) to jump to a specific image in the gallery.

Usage:
myThumbGallery.loadImage(3)

 

ThumbGallery.startAutoPlay(number)

 

Parameter:
Number: How many seconds to display the image before displaying the next. If no parameter is set, the value from the propert "autoPlay" is used.

Description:
This method will start the automatic display of images. An image will display for the set number of seconds before the next image is displayed.
When this method is invoked, the next image following the currently selected image will display.


Usage:
myThumbGallery.startAutoPlay(3)

 

ThumbGallery.stopAutoPlay()

 

Description:
This method will stop the automatic display of images. To restart, use the method: startAutoPlay()

Usage:
myThumbGallery.stopAutoPlay()

 

ThumbGallery.getWidth()

 

Description:
Returns the total width of the gallery. This method is only available after the XML is loaded and the gallery is drawn. This method is available after the event .onDrawComplete() has been called.

Usage:

myThumbGallery.onDrawComplete =function{
  var gWidth= myThumbGallery.getWidth()
  trace(gWidth)
}

 

ThumbGallery.getHeight()

 

Description:
Returns the total height of the gallery. This method is only available after the XML is loaded and the gallery is drawn. This method is available after the event .onDrawComplete() has been called.

Usage:

myThumbGallery.onDrawComplete =function{
  var gHeight= myThumbGallery.getHeight()
  trace(gHeight)
}

 

ThumbGallery.setStyle()

 

Description:
This method is only useful if you are displaying numbers as your thumbnails. With this method you can change the style of the numbers.

setStyle() accepts the following styles:

Style

Description

numberFont

The font used for the numbers. Default value is "Arial"

numberColor

The text color of the numbers. The default value is 0x333333

numberFontSize

The font size of the numbers. The default value is 10

numberBold

Boolean value that indicates if the numbers are bold. The default value is false.

numberEmbedFonts

A Boolean value that indicates whether the font specified in numberFont is an embedded font. This style must be set to true if numberFont refers to an embedded font. Otherwise, the embedded font will not be used. If this style is set to true and numberFont does not refer to an embedded font, no text will be displayed. The default value is false.



Usage:
myThumbGallery.setStyle("numberEmbedFonts", true);
myThumbGallery.setStyle("numberFont", "myFont");
myThumbGallery.setStyle("numberFontSize", 12);

 


Actionscript Events
 


ThumbGallery.change

 

Description:
Event; broadcast to all registered listeners when a primary image is finished loading. The event object contains all XML node values for the current image. Any additional nodes added to the XML file can also be read from the event object. For example, you could add a node for each image such as:<imageID>10</imageID> You could then access the value by using:eventObject.imageID The example below will display the values contained in the <caption> and <img> nodes of the XML file.

Usage:
listenerObject = new Object();
listenerObject.change = function(eventObject){
  trace(eventObject.caption)
  trace(eventObject.img)
}
ThumbGalleryInstance.addEventListener("change",listenerObject)

ThumbGallery.thumbRollOver

 

Description:
Event; broadcast to all registered listeners when a thumbnail is rolled over. The event object contains all XML node values for the thumbnail that is currently rolled over. Any additional nodes added to the XML file can also be read from the event object. For example, you could add a node for each image such as:<imageID>10</imageID> You could then access the value by using:eventObject.imageID The example below will display the values contained in the <caption> and <img> nodes of the XML file

Usage:
listenerObject = new Object();
listenerObject.thumbRollOver = function(eventObject){
  trace(eventObject.caption)
  trace(eventObject.img)
}
ThumbGalleryInstance.addEventListener("thumbRollOver",listenerObject)

ThumbGallery.thumbRollOut

 

Description:
Event; broadcast to all registered listeners when a thumbnail is rolled off. The event object contains all XML node values for the thumbnail that was just rolled off. Any additional nodes added to the XML file can also be read from the event object. For example, you could add a node for each image such as:<imageID>10</imageID> You could then access the value by using:eventObject.imageID The example below will display the values contained in the <caption> and <img> nodes of the XML file.

Usage:
listenerObject = new Object();
listenerObject.thumbRollOut = function(){
  trace(eventObject.caption)
  trace(eventObject.img)
}
ThumbGalleryInstance.addEventListener("thumbRollOut",listenerObject)

ThumbGallery.thumbClick

 

Description:
Event; broadcast to all registered listeners when a thumbnail is clicked on. The event object contains all XML node values for the thumbnail that was just clicked on. Any additional nodes added to the XML file can also be read from the event object. For example, you could add a node for each image such as:<imageID>10</imageID> You could then access the value by using:eventObject.imageID The example below will display the values contained in the <caption> and <img> nodes of the XML file.

Usage:
listenerObject = new Object();
listenerObject.thumbClick = function(eventObject){
  trace(eventObject.caption)
  trace(eventObject.img)
}
ThumbGalleryInstance.addEventListener("thumbClick",listenerObject)

ThumbGallery.autoPlayStopped

 

Description:
Event; broadcast to a registered listener when the autoPlay feature has stopped due to either the user clicking a thumbnail or one of these methods is invoked: nextImage(), prevImage(), or loadImage(). Note that this event will only trigger when the property "stopAutoOnClick" is set to true.

This event is useful if you need to update controls or messaging when the autoPlay feature is turned off. AutoPlay can be turned back on using the method: startAutoPlay()

Usage:
listenerObject = new Object();
listenerObject.autoPlayStopped = function(){
  trace("Auto playing has stopped")
}
ThumbGalleryInstance.addEventListener("autoPlayStopped",listenerObject)

ThumbGallery.onDrawComplete

 

Description:
This event is executed after the gallery XML is loaded and the gallery elements, such as the background rectangle, are drawn. This is useful is you want to immediately use the methods getWidth() and getHeight()

Usage:
myThumbGallery.onDrawComplete =function{
  var galleryWidth= myThumbGallery.getWidth()
  trace(galleryWidth)
}

 


Requirements
 


To use the stand-alone ThumbGallery Template, you just need a text editor to update the XML file. Your browser must have Flash Player 7 or 8 installed. This is a free plugin available here.

To use the ThumbGallery Component you need Macromedia Flash MX 2004 or Flash 8 (Standard or professional) Window or Macintosh. May be published for Flash Player 7 or 8.




Disclaimer and Privacy Policy