[flexcoders] Re: How to converst an XML to AS Object ?

2007-09-26 Thread booleanbetrayal
I've got a few examples of how to go about using this sort of implementation with SimpleXMLDecoder along with recursive ObjectTranslator calls, tied into HTTPService calls using xmlDecode =] http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/ Hope thi

Re: [flexcoders] Re: How to converst an XML to AS Object ?

2007-09-25 Thread Anakin Skywalker
This is some very interesting code. I can see a great value using this code to convert data returned by a web service into Flex objects. Three issues come to mind. 1) I don't always construct an object from XML. Sometimes, I construct an object with data returned from a web service,

Re: [flexcoders] Re: How to converst an XML to AS Object ?

2007-09-22 Thread Roger Braunstein
Hi there, Tony Alves tipped me off that there was a thread about this when I posted my article on instant binding to XML models. Feel free to use the code I present in my approach here: http://www.partlyhuman.com/blog/roger/instant-model-binding-with-reflection Cheers! Roger Braunstein

[flexcoders] Re: How to converst an XML to AS Object ?

2007-09-15 Thread lytvynyuk
Thank you Troy, for your suggestions. I cannot understand one thing, using SimpleXMLDecoder i got Object from XML BUT I cannot make this ObjectProxy cast to my Album Object. What is the condition to cast object fields are same, I cant understand how does it works :( --- In flexcoders@yahoogr

Re: [flexcoders] Re: How to converst an XML to AS Object ?

2007-09-12 Thread Troy Gilbert
> Does anybody have good examples how SimpleXMLDecoder works ? I've never found a good one. Senocular has a library called XMLDefinition (google it). I've not looked at it too much, but it superficially appears to do what you're looking for. I don't like the idea of passing the XML into the objec

[flexcoders] Re: How to converst an XML to AS Object ?

2007-09-12 Thread lytvynyuk
Does anybody have good examples how SimpleXMLDecoder works ? --- In flexcoders@yahoogroups.com, "lytvynyuk" <[EMAIL PROTECTED]> wrote: > > Thank you I kinda knew about that way ;) > but if my object contains30 fields and also has a bunch of another > objects, this procedure will be painful ;) >

[flexcoders] Re: How to converst an XML to AS Object ?

2007-09-09 Thread lytvynyuk
Thank you I kinda knew about that way ;) but if my object contains30 fields and also has a bunch of another objects, this procedure will be painful ;) What about this way: public function result(event:ResultEvent):void { var xmlS:XML = XML(event.result); var decoder:SimpleXMLDecoder = new Simple

[flexcoders] Re: How to converst an XML to AS Object ?

2007-09-09 Thread Derrick Grigg
You can't automatically convert XML to a strong typed object. You should create a method in your Album class that takes an xml variable, and then populate the Album from there. ie var album:Album = new Album(); album.setData(event.result); class Album { public function setData(data:XML):vo