PDA

View Full Version : Updating Flash file via XML


jjfossey
01-24-2007, 07:16 PM
I am new to the world of Flash and XML, and don't fully understand the relationship between the two and how they interact (I'm learning), but I was wondering if it's possible to update a Flash file via an XML file. Here's the scenario:

I have a Flash file that is an interactive map. I want to be able to update this map/file by editing the XML file for it. When I save my edits to the XML file, the map will automatically update. Is this possible? If so, what is the simplest way to do this? Can the XML file be called externally like a CSS of JavaScript file? Thanks in advance for your help.

Noct
01-24-2007, 08:29 PM
Xml is essentially used as a big text array that you can call from. The only real difference between using xml or a plain txt file is that you can specify "nodes" (subSets) of information.

You could store any information you wanted in there and call it, so in that sense, you could make changes that would "update" the original file to some degree. I mean the obvious stuff is text changes, but I suppose you could just as easily store properties in there.

Like, say I have a box on my stage that is 50 pixels wide. I could make an xml node to hold that property, and change that on the fly via AS.

Something like:

boxNode = _root.retrieveSubnode(_root.pageNode, "box");
var myBoxWidth:Number = boxNode.childNodes[x];
myBox_mc._width=Number(myBoxWidth)

jjfossey
01-24-2007, 08:35 PM
Thanks for your help Noct!