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)

mheavers on 9th July 2008

Hey - I'm using your XML2Object extension for the first time and it works great on my local machine but doesn't seem to be working on the shell that I have to upload to. Any idea why it would work one place and not the other? I've checked and the reference to my XML path is correct. The only thing I can think of is that it is not importing your class properly. Is there a way to just include all of the actionscript necessary to run this within my flash file?Also, the XML that appears in my dropdown lists ends up in reverse order from how it is organized in the XML file. How do I fix that?

Thanks!

mheavers on 8th July 2008

Hey - I'm using your XML2Object extension for the first time and it works great on my local machine but doesn't seem to be working on the shell that I have to upload to. Any idea why it would work one place and not the other? I've checked and the reference to my XML path is correct. The only thing I can think of is that it is not importing your class properly. Is there a way to just include all of the actionscript necessary to run this within my flash file?Also, the XML that appears in my dropdown lists ends up in reverse order from how it is organized in the XML file. How do I fix that?Great work. Thanks!

evanrm on 11th April 2008

Thanks for this. I 've had the idea to do this for a while, but never got around to it. I'm glad I found this before I actually did it. Thanks again!

nameez on 29th February 2008

HI,

This is a great class works fine for me to convert an object to xml thanks!!

but when trying to add the xml to a temp variable it returns NaN

this is the code:
var outXml
tempX = new XMLObject().parseObject(Myitem, "item");
outXml += tempX;
trace(outXml); // traces NaN

can i know why?
Thanks

mary on 27th December 2007

This is working great to access all the attributes, but I cannot retreive the correct length of a node. Can you help?


Here's my xml:
<?xml version="1.0" encoding="utf-8"?>

<vehiclelist>
<buildAnotherVehicleURL></buildAnotherVehicleURL>
<tabone><![CDATA[GM Family First]]></tabone>
<tabtwo><![CDATA[GM Supplier Discount <br><i>For Friends</i>]]></tabtwo>
<vehicle>
<image>sampleVehicle.jpg</image>
<logo>chevyLogo.jpg</logo>
<vehicleInfo><![CDATA[2007 Chevrolet Silverado 1500 Extended Cab SLE 1 2WD with optional equipment*]]></vehicleInfo>
<allprices>
<price amount="100,000"><![CDATA[MSRP (1sticker price on vehicle)*]]></price>
<price amount="200,000"><![CDATA[MSRP (2sticker price on vehicle)*]]></price>
<price amount="300,000"><![CDATA[MSRP (3sticker price on vehicle)*]]></price>
<price amount="400,000"><![CDATA[MSRP (4sticker price on vehicle)*]]></price>
<price amount="200,000"><![CDATA[MSRP (5sticker price on vehicle)*]]></price>
<price amount="300,000"><![CDATA[MSRP (6sticker price on vehicle)*]]></price>
<price amount="400,000"><![CDATA[MSRP (7sticker price on vehicle)*]]></price>
</allprices>
<vehicleUrl>http://www.gm.com/</vehicleUrl>
<disclaimer><![CDATA[Disclaimer here]]></disclaimer>
<disclaimerAction>out or in by default</disclaimerAction>
</vehicle>

</vehiclelist>

When i try to retrieve the length of <allprices> it gives me the incorrect number..
This is the Flash call:
vehiclePriceLength = as2obj.vehiclelist.allprices.data.length;

calvincrane on 21st November 2007

Use the version that works as an extension. There is some code in a "revisited" headed webpage on this site that doesnt work fully and took a while to realise it was the class (I assumed it was me !)

essentially I couldnt access the first item of an array of elements, I think this has been since he fixed the original bug which was almost the reverse if you just had one element. I just would like to say to save you time, but thanks sep- it did save time ..

jason on 12th November 2007

I am using XML2Object and the varibles are showing correctly in my Output. I need to STORE and USE these variables throughout my Flash (FLA). How can I convert these into VARs that Flash will recognize. They only exist within the XML and I need them to exist outside of the XML. Any help is HUGELY appreciated!

trinitron00 on 30th October 2007

just about to try this will see how it goes

tony.x.stewart.-nd on 15th August 2007

Hey I'm using and loving this component. I've been able to use it accordingly, however the one question I have now that I've gotten underway of using external data inside my flash projects is I can't seem to apply any kind of style to specfic nodes. I can apply styling via the properties panel to all the content of a textfield, font color, size, etc., but if I want to apply say Bold for instance to one particular area of the
imported text I'm having a problem figuring this out.

Any ideas!

Thanks in advance!

Tony

fauzi.rachman on 7th May 2007

Hmm.. How to put HTML text from XML nodes :/

Add your comment