XML Column Data Source Generator Object v 1.2
The object takes XML and makes it available to Macromedia Generator in a format that Generator can use (a result set like Column format). It utilizes the Generator SDK, the Apache Xerces XML parser, and the JDOM XML API.
Latest Updates
- Fixed a few small bugs
- Added untested directions on how to get the object to work on Macs.
- Added itemNum value which is the index of the current item / row of data.
- Added Maximum Number of Items property which defines the maximum number of items to return from the XML.
The example on the right is using Generator to dynamically pull in XML news feeds from moreover.com and insert them into a Flash movie.
The news feeds are updated once an hour using offline Generator and are scheduled using a crontab job. Here is what one of the entries in the crontab job looks like :
Requires Flash 5 Player
Download demo files (FLAs).
$ generate -swf /home/mesh/public_html/../flash/XMLNewsMP3.swf \
/home/mesh/public_html/../flash/xmlNews.swt -param newsSubject mp3 \
-param maxItems 5 -param subject "MP3 News"
Flash 5 / Generator tip Here is how to dynamically define a int / number value in Flash 5 using Generator :
var variableName = int("{genValue}");
This is because all generator variables being dynamically placed in action script must be enclosed in quotes. For more info view this tech note on Using Generator variables in Flash 5 Action Script.
Download the object and its source from the Flash Exchange.
More info on Macromedia Generator