Xml format
PhotoEmbed loads gallery data from a simple xml file.
The default location where it looks for the file is the images/directory.xml relative to photoembed.swf.
The xml url can be set by FlashVars variable xmlUrl.
You can also generate the xml file with a php script, in that case xmlUrl would point to a php file.
The xml file should have the following structure:
<root> <images> <item name="IMG_0190.JPG" thumb="IMG_0190_.JPG" thumbwidth="120" /> <item name="IMG_0191.JPG" thumb="IMG_0191_.JPG" thumbwidth="90" /> <item name="IMG_0195.JPG" thumb="IMG_0195_.JPG" thumbwidth="120" /> <item name="IMG_0196.JPG" thumb="IMG_0196_.JPG" thumbwidth="120" /> <item name="IMG_0197.JPG" thumb="IMG_0197_.JPG" thumbwidth="200" /> </images> </root>
If you don’t set the thumb attribute PhotoEmbed will display the big images as thumbnails.
You can use PhotoAdmin to automatically create the thumbnails and directory.xml.
The thumbwidth attribute is optional – if not set PhotoEmbed will use a default value of 90 px.
Customizing PhotoEmbed
You can customize PhotoEmbed by passing Flash variables:
- xmlUrl – relative path or url of gallery xml; the default value is
images/directory.xml - galleryUrl – relative path or url of the folder containing the images; default value is
images - padding – padding of the movie; buttons and scrollbar are places inside this; default is 8px
- bgColor – background color of the movie; default color is #dddddd
- thumbnails – wether to show thumbnails at startup; default true
- thumbWidth – thumbnail width, only used if there’s no thumbwidth value set in xml; defaults to 90 px
- thumbHeight – thumbnail height; default value is 90 px
- imagePadding – additinal padding around the image; default value is 0 px
- scaleMode
- fit – images are scaled to fit the image area – default value
- fill – images are scaled to fill the images area, some part of the image is not visible
- none – image is displayed in original size
Here is a typical embed code:
<object width="550" height="400"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="/photoembed_1.0/photoembed.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#eeeeeee" /> <param name="FlashVars" value="xmlUrl=/photoembed_1.0/images/gal1/directory.xml&galleryUrl=/photoembed_1.0/images/gal1"/> <embed src="/photoembed_1.0/photoembed.swf" name="photoembed" width="550" height="400" quality="high" bgcolor="#eeeeee" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="xmlUrl=/photoembed_1.0/images/gal1/directory.xml&galleryUrl=/photoembed_1.0/images/gal1"/> </object>
Great stuff here. I was just wondering if PhotoEmbed can make use of the description/title attributes set in the xml using PhotoAdmin to display image title? Thanks for reply.
I have just uploaded the full source. So just open the fla in Flash CS3 or later and edit the code to make use of the xml attribs.
How do you configure to work with a website. Which files do you need to upload to a web server.
You only need the swf file + the embedding html and swfobject.js. Withe the default config it will try to load xml from an
imagesfolder. See details above.