No one else responded so I’ll take a shot.

 

For dynamic properties, like in an mx:object, the for..in loop should return a reference to each property.  So maybe something like:

 

Var sXML:String = “<root>”

For (var prop in myObject)  {

            sXML += “<” + prop + “>” + myObject[prop] + “</” + prop + “/>”;

}

sXML += “</root>”

 

Tracy


From: [email protected] [mailto:[email protected]] On Behalf Of richmcgillicuddy
Sent: Thursday, September 28, 2006 10:47 AM
To: [email protected]
Subject: [flexcoders] Conversion from Array to XML

 

I have an array that my user is editing in a data grid. I want to be
able to convert that back to an XML object. Is there a generic easy
way to do this. My array has objects that look like:

var myObject : ObjectProxy = new ObjectProxy();
myObject.f1 = 1;
myObject.f2 = 2;
myObject.f3 = 3;

I want to convert that (generically by determining at runtime, which
fields the object proxy has) to:

<Object>
<f1>1</f1>
<f2>2</f2>
<f3>3</f3>
</Object>
<Object>
...

Is there a simple way to convert an array to an XML object or get an
XML string representation of an array without hard coding this for
each grid I'd want to do this for?

Rich

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to