XML Flash Slideshow v4 Help    |    Support Home    |    DWUser.com Home  Download Help PDF (29MB)    |    Search:

Understanding How Dynamic Data Works

When you create a slideshow in the wizard, you manually create galleries and add images to these galleries.    For most instances, this is fully sufficient.    However, sometimes as an advanced user or developer you may want to be able to populate galleries -- or even define galleries -- on the fly, based on changing ("dynamic") information.    This can include images in a given directory, database contents (via a recordset), or data from other external sources such as Flickr.    Integration of this type of data is accomplished through the use of Dynamic Data Sources.    These are special URL's which are passed to the slideshow.    The slideshow loads the data from these URL's, transforms it to the slideshow image-data format if necessary, and adds it to the static XML configuration file as if it had been added in the wizard manually.

One of the most common uses of dynamic data is to allow a client to manage their slideshow images directly from a third-party service such as Flickr.  The client uploads images to Flickr and specifies title and description/caption information.  As soon as the client makes changes, these are reflected in the slideshow live on their site.    Because you can integrate specific Flickr photoset, the client can manage multiple slideshows from a single account.    More information on this is available in the 'Managing Dynamic Data in the Wizard' topic, which details Flickr API integration.

If you're comfortable with server-side programming, you can also write your own scripts which dynamically generate image data.    For more information on this and example code, see the 'Creating Data Sources + Example Code' topic.

Loading from Different Domains

If you load dynamic data from an external source (a different domain), you may be affected by Flash Player cross-domain loading security restrictions.    To learn more about this, see the Understanding Flash Player Cross-domain Loading Restrictions topic.    Note that some sources, such as Flickr, have unrestricted policy files, so you won't be affected by these restrictions.

Passing Parameters to Dynamic Data Sources

Especially if you are writing and using your own dynamic data source scripts, you may need to pass parameters to the dynamic data source file.    For example, you might need to display images of a certain property based on the property being displayed on the slideshow page.    The slideshow might be in property_details.php?property_id=12345 .    In this case, you would need to let the dynamic data script know that it should retrieve and output image information for property 12345.    To do this, you must configure your dynamic data script to use a passed property_id parameter, then mirror this value to the dynamic data source URL.    In your slideshow HTML code, you would need to locate the xml:'...' value, which tells the slideshow where to load all data from.    This value will contain the URL of the dynamic data source you added in the wizard.    At the end of this URL, add the appropriate code to output the property_id parameter.  For example:

... xml:'v4flashslideshow/slideshow_dataN.xml,slideshow_data.php?property_id=<?php echo($_GET["property_id"]); ?>', ...

Note that this example has no data value validation, and should NOT be used in production.

The point is that you must mirror any needed parameters to the data source through its URL.    These parameters will then be accessible from the dynamic data source file.