1 Reply Latest reply on Jun 4, 2009 11:15 AM by BennyBeta

    xml encoding of custom made objects

    kerna1

      I have made a custom class that takes in data from a remote server (accessed through a remote object) and converts it into a value object in my application. Now, I want to parse this value object into XML. So far I have read XML supports many AS predefined objects. Is there a way I can encode and decode custom made objects into XML as well?

        • 1. Re: xml encoding of custom made objects
          BennyBeta Level 4

          A simple (though hand-coded) toXML() function could look like:

           

          public function toXML():XML

          {

          var xmlObject:XML = <object></object>;


          xmlObject.@property1 = object.property1;

          xmlObject.@property2 = object.property2;


          return xmlObject;

          }

           

          Let me know if that helps or if you're looking for something different.

           

          Ben Edwards