Enter Flash 5
Enter Flash 5.
Flash 5 has a very good implementation of XML in ActionScript, allowing you to pull XML content into your flash movies and parse through it to get at the data. This is accomplished with the new XML Object. You create a new XML Object in ActionScript with the following:
my_variable = new XML();
Flash then let's you load up any xml content you wish from a url and load it into this new object by calling the XML Object's load() command.
It is important to note that the url you pass flash does NOT have to be an xml document, per se. That is, the file does not have to be a file at all, certainly not one that ends with the .xml extension. It could be a call to a server-side script or cgi program, with parameters passed along. This is great if you want to load up data from a database or records from an ldap server from a script on your web server, and serve up the data to a flash movie. Just format the output of the script as xml, and flash can read it no problem.
A note: flash's implementation of xml only allows you to pull remote xml files from within the flash standalone player. For flash movies on the web, the xml files you wish to use must come from your domain, or from a local source on your webserver's file system.
|» Level Advanced|
Rating: 9 Votes: 705
|No information about the author has been provided|
|Download the files used in this tutorial.|
|Download (44 kb)|
|More help? Search our boards for quick answers!|