Visit SlideShowPro.net  Community Forums
SlideShowPro Support Wiki
  
Using without Director

Creating an XML file

This chapter will explain how to create your own XML document for use with the SlideShowPro Player. 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 the SlideShowPro Player 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 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, the SlideShowPro Player 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

The SlideShowPro Player 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 the SlideShowPro Player'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 other documents as we add optional features like thumbnails, hyperlinks and captions.

Page last modified by tdominey on December 03, 2010, at 09:29 AM
© 2011 SlideShowPro. All Rights Reserved.