3 Replies Latest reply on Jul 29, 2010 12:57 AM by Balakrishnan V

    Data to XML

    GeorgeWS Level 1

      I have a sample I am using that uses an xml file to populate the controls. like:

      service = new PhotoService("data/galleries.xml")


      This works but I want to gather the data from a server database instead. What should I do?

      Get data with remoteobject and convert that to an xml file? Sample?


      Thanks George

        • 1. Re: Data to XML
          rtalton Level 4

          You could use a HTTPService to load the xml file.

          • 2. Re: Data to XML

            you can use several methods and services, Basically you just need your SQL to output a xml file. There are some great tutes at the Learn Flash in a week page:





            • 3. Re: Data to XML
              Balakrishnan V

              Importing an xml is very easy using the DCD-wizard in Flash Builder 4.


              You can alternatively have the following mxml/As code.



              <?xml version="1.0" encoding="utf-8"?>

              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"


                 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="SendHTTPService()">



              protected var data:Object;

              import mx.rpc.events.ResultEvent;

              protected function SendHTTPService():void




              protected function myHttpService_resultHandler(event:ResultEvent):void








              <!-- Place non-visual elements (e.g., services, value objects) here -->

              <s:HTTPService id="myHttpService"







              You may box your data:Object into any other datatype as well as per the requirement



              Hope  this helps,


              balakrishnan v