Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Forum's topics

Latest Files

Categories

XML2Object

Flash Version: Flash MX 2004
Total downloads: 21943
Category: Component
File last revision: 16, Mar 2007 01:03:46
License: LGPL

Flash MX 2004 Class:
This class allow you to tranform every kind of XML file into a Native AS Object. Inside the .zip there is also an example on how to use it

(Updated to work with Flash8)

 Comments Feed

Do you like this file? Please make a little donation

Flash content

 

Comments (125)

dev on 5th November 2009

hey chris,
that's exaclty the problem i'm having.

jack on 3rd November 2009

This class corrupts Japanese characters in XML files! Where can I find an older version of this class that handles asian characters correctly?

uggol966 on 23rd September 2009

Office webiste http://www.uggol.com

r on 25th August 2009

rrr

zeljko_dizajn on 17th August 2009

I have a problem i instaled a XML2Object buth when I use:
import it.sephiroth.XML2Object;

compiler trows:
1172: Definition it.sephiroth:XML2Object could not be found.

sayhellotohelen on 27th July 2009

that is great posting

jerry on 26th July 2009

i don't quite understand. can anyone be so kind to explain it to me?

jerry on 22nd July 2009

thanks . useful information.

sini on 6th July 2009

the problem with the code here is if there is only one node there will not be generated an array but an object

if you have a xml like this:

<xml>
<config>
<setting name=x>100</setting> <setting name=y>100</setting> <setting name=rotation>90</setting> <setting name=alpha>100</setting> </config></xml>

the access to the data is like this:

xml2obj.xml.config.setting[0].dataxml2obj.xml.config.setting[1].dataxml2obj.xml.config.setting[2].dataxml2obj.xml.config.setting[3].data

but if there is only 1 setting item like this:

<xml> <config> <setting name=x>100</setting>
</config>
</xml>

then the access is not as you probably would anticipate

xml2obj.xml.config.setting[0].data

but

xml2obj.xml.config.setting.data
if a node in a xml has no siblings with same name it is NOT defined as an array. it will be defined as an object, like xml or config in this example.

so you have to change the xml2object class to allways define a array for every node. then the access would be like

xml2obj.xml[0].config[0].setting[0].data

OR

you have to check if xml2obj.xml.config.setting.length is undefined AND xml2obj.xml.config.setting NOT undefined to access with

xml2obj.xml.config.setting.data

for the case there is only 1 item. for all cases where > 1 item appears in the xml you go as usual with

xml2obj.xml.config.setting[0].data

i hope this helps

szwddlm on 27th June 2009

Ugg-- http://www.uggbootsvip.com
ugg boots-- http://www.ugg-mall.com,
cheap ugg boots-- http://www.ugg-mall.com,
ugg cardy-- http://www.ugg-mall.com
cheap ugg cardy boots-- http://www.ugg-mall.com
ugg classic cardy-- http://www.ugg-mall.com/ugg-classic-cardy-boots.html
cardy ugg boots-- http://www.ugg-mall.com/ugg-classic-cardy-boots.html
ugg classic cardy boots-- http://www.ugg-mall.com/ugg-classic-cardy-boots.html
ugg classic tall-- http://www.ugg-mall.com/ugg-classic-tall-boots.html
ugg boots uk-- http://www.ugg-mall.com/ugg-classic-short-boots.html
hydraulic tools-- http://www.tpttools.com
PVC pipe fittings-- http://www.z-plast.com/product_3_2.htm
PVC window-- http://www.z-plast.com
wow gold-- http://www.wowgold-shopping.com

Add your comment