Groups | Blog | Home
all groups > flash data integration > july 2005 >

flash data integration : flashvars and xml config file



ay13
7/11/2005 7:27:03 PM
can anyone give me an example or point me to an example where you load in a
config file in xml format into flash using flashvars.. and how to decode the
xml file in flash to pass the right variables to the right areas in flash..
the dude881
7/14/2005 12:00:00 AM
Flash can load external XML data using the XML Object. You can load from a
file, server page, etc. Here is a basic example of how to load from a
config.xml file (posted at the bottom). For decoding, that can mean almost
anything and you need to be more clear on what you're looking to do / what the
xml file structure is. Since I cannot answer that part of the question with the
information given, here is a link to basic xml properties and how to access
them:
http://livedocs.macromedia.com/flash/mx2004/main_7_2/00001882.html#4599366.

//Load Config.

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.load("config.xml"); //replace congig.xml with your filename.

myXML.onLoad = function(success)
{
if(success)
{
//decode data.
} else {
trace("Error: unable to load from specified file.");
}
}
AddThis Social Bookmark Button