Visit SlideShowPro.net  Community Forums
SlideShowPro Help Wiki
  

SlideShowPro for Flash

Creating an XML document

This chapter will explain how to create your own XML document for SlideShowPro for Flash to load. It will address the core elements a slideshow needs in order to operate, as well as options for linking to content. Further chapters in this section will build upon these examples.

XML editing basics

To create your own XML file, you must use a HTML/ASCII text editor. Free editors include Notepad (Win) and TextWrangler (OS X). You can also use for-sale editors like Dreamweaver (Win/OS X), and TextMate (OS X). Do not use a word processor or rich text editor like Microsoft Word (Win/OS X) or TextEdit (OS X).

Loading content

This is the XML markup SlideShowPro for Flash requires, at a minimum, in order to work:

<?xml version="1.0" encoding="UTF-8"?>
<gallery>
   <album>
      <img src="ContentURL" />
   </album>
</gallery>

ContentURL may be an absolute or relative path to the content you wish to load. To add absolute paths to slideshow content, modify src like so:

<?xml version="1.0" encoding="UTF-8"?>
<gallery>
   <album>
      <img src="http://www.domain.com/path/to/my/image.jpg" />
   </album>
</gallery>

For relative paths, and lighter XML markup, you can use a special lgpath constructor. Simply add lgpath to the album element and fill it with the absolute path to the folder containing that album’s slideshow content. You can then modify each src value to only include a file name, like so:

<?xml version="1.0" encoding="UTF-8"?>
<gallery>
   <album lgpath="http://www.domain.com/path/to/my/">
      <img src="image.jpg" />
   </album>
</gallery>

If you’d like to keep all content relative so that it can work locally as well as online, you can use a relative path for lgpath. The path should be relative to the HTML document embedding the SWF you publish (which by default is in the same directory). Here’s the above example revised with relative paths:

<?xml version="1.0" encoding="UTF-8"?>
<gallery>
   <album lgpath="path/to/my/">
      <img src="image.jpg" />
   </album>
</gallery>

In both examples, SlideShowPro for Flash will take the value of lgpath and append the value of src to form a complete link to each piece of slideshow content.

Album titles / descriptions

Album titles and descriptions appear in the gallery. To assign these, modify your album elements like so:

<album title="My album title" description="My album description" lgpath="path/to/my/">

Additional albums

To load more than one album in a gallery, simply create another album group, like so:

 
<?xml version="1.0" encoding="UTF-8"?>
<gallery>
   <album title="Album 1" lgpath="gallery/firstAlbum/lg/">
      <img src="image.jpg" />
   </album>
   <album title="Album 2" lgpath="gallery/secondAlbum/lg/">
      <img src="image.jpg" />
   </album>
</gallery>

XML File Path

SlideShowPro for Flash automatically looks for XML files you create in the same folder as your SWF. It expects the file to be named “images.xml,” but it doesn’t have to be. Nor does the XML file need to be in the same folder, or even on the same server. You can change SlideShowPro for Flash’s XML File Path to a relative or absolute URL.

Note: If you plan on loading XML data from a different domain than the one that will contain your SWF, read the Can't load XML data from a different domain tip for information on how to avoid problems.

Summary

The preceding examples will be seen again in the upcoming chapters as we add optional features like thumbnails, hyperlinks and captions.

Page last modified by tdominey on January 24, 2009, at 04:10 AM
© 2010 Dominey Design Inc. All Rights Reserved.
About | Merchandise | Contact | Privacy policy | Legal | Licensing