Description: A dynamic photo album read from an xml file
Author: John Bezanis
Added: November 4th 2007
Version: Flash 8
This applet reads an xml file and puts together an image slider where an image is displayed at a larger size when clicked. The images are automatically scaled for best fit, and any dimensions will work. There are 3 attributes within each image node; the thumbnail, the caption for the pic, and the fullsized pic. Example format for the xml file:
<image><thumb>thumbofpic1.jpg</thumb><caption>Pic 1 caption</caption><pic>pic1.png</pic></image>
<image><thumb>thumbofpic2.png</thumb><caption>pic 2 description</caption><pic>pic2.jpg</pic></image>
The default url for the xml file is sliderfeed.xml, but it can be set with the variable xmlfile like so:
<object data="39-albumslide.swf?xmlfile=someotherxmlfile.xml" type="application/x-shockwave-flash" width="500" height="400">
<param name="movie" value="39-albumslide.swf?xmlfile=someotherxmlfile.xml"/>
The applet can be used with any background color, by changing the color in document properties and setting the variable bgcolor on the main level to that corresponding color.
The Stage can be set to any size, with some minor adjustments.
To change the size of the maximized image, open up the movie clip imageholder and resize the instance "canvas" to the new dimensions. Exit out of the movie clip imageholder and move it to the new location.
The slider can be resized as well. Open up the movie clip slidercontainer and resize the instance "bg" to the new dimensions. Exit out of the movie clip slidercontainer and move it to the new location.
The source code with line by line comments is available below:
Download the Source File
Download the Built swf File
Comments Currently Disabled