Total downloads: 6767
Category: Flash AS
File last revision: 20, Sep 2005 01:09:37
License: LGPL
Similar to the XML2Object class but with a new method, parseObject, which allows you to transform a flash object into an XML.
There is also a modification to the parseXML method:
.parseXML(xml:XMLNode, allinarray:Boolean)
if allinarray is true everything will be parsed into array (differently from the previous XML2Object version)
Flash content
Comments (39)
Is there an AS3 version for this class. Is really, REALLY useful.
Podrian mandarme algun ejemplo de como funciona la clase para parsear un XML...
Saludos Yo....
Did anyone solve the one-node problem? Please reply.
little example with array function:
var xml_material : XML = new XML ();
var to_obj : Object = new Object ();
xmlLoaded = function ()
{
var contentObj = new XMLObject ();
to_obj = contentObj.parseXML (this, true);
trace (to_obj.calendar[0].exhibition[0].pics[0].pic.length);
trace (to_obj.calendar[0].exhibition[1].pics[0].pic.length);
trace (to_obj.calendar[0].exhibition[2].pics[0].pic.length);
split_pictures ();
}
xml_material.ignoreWhite = true;
xml_material.onLoad = xmlLoaded;
xml_material.load ('xml.xml');
Has anyone noticed that when using this tool inconjuction with dynamic text fields and after a burning in version Flash 8, the dynamic text fields display extra carriage returns between section nodes? Typically, to mirror normal paragraph structure seen when reading content w, it makes sense to either use html text with paragraph tags, manual line breaks or carriage returns within nodes with CDATA to make paragraph and content structure easy to read and manuever. But a Flash 8 burn reads these returns and breaks, but also ads an extra one to the fray. Putting it plainly, the space between paragrahs is doubled. Burning down on Flash 7 doesnt have that problem, but you can potentially lose any of the nice Flash 8 eye candy or effects or scripting not available to Flash 7 by doing so. any thoughts?
Has anyone figured out how to get this class to read through CDATA tags. I'm trying to use this to read through RSS feed that has a bunch of CDATA tags. It's driving me mad. It works great for all my other xml needs but when it reaches the CDATA it just won't parse through it.
is there a way of arraying the attributes for an xml node?
sample xml:
<node myx="10" myY="0"> my data </node>
<node myx="20" myY="20" myRotation="12"> my data </node>
<node myx="30" myText="hello!"> my data </node>
theoretical xmlObject return:
node[0].attributes.length = 2
node[0].attributes[0].name = "myx"
node[0].attributes[0].value = "10"
node[1].attributes.length = 3
node[1].attributes[1].name = "my"
node[1].attributes[1].value = "20"
thanks!
Hi Alessandro,
this is just the greatest tool I've used to parse my XML. One thing it lacked was the typecasting for Boolean and Number objects. I made a verry simple modification to your class to implement this. So if you're interested in including it in a later version of the class you can contact me by e-mail !
I just don't understand why coders want to use XPATH if this class exists ! It's soo much faster and hassle free ! :)
Great job !
best parser I've come across. Great stuff.
which kind of issue?
