2 Replies Latest reply on Aug 25, 2006 9:34 AM by blackshirt

    How to read xml file

    blackshirt
      I want to create a component to read a XML file in Flex 2 using Actionscript. I am able to do this using URLRequest and URLLoader but what happens is the component that calls my reader component keeps running through the code and the Complete event never gets called.

      So my question is how can I read a XML file through AS and return a value in that XML file all in a synchronized manner?

      Thanks
        • 1. Re: How to read xml file
          ntsiii Level 3
          All data access in Flex is asynchronous.

          There is NO WAY to stop or pause code execution in the Flash Player.

          You will need to use events to complete the processing after the call returns. This is a tough paradigm if you are new to it, but there is no other way.

          Resistance is futile.

          Also, in a related vein, Alert and other "modal" pop-ups are not truly modal. They do not stop code execution, and you must use events to continue processing.

          Tracy
          • 2. Re: How to read xml file
            blackshirt Level 1
            Since I am using the Cairngorm framework I decided to use the <mx:Model to read in my XML file. Then I assigned the value I wanted from the XML file to my ModelLocator so I could pass it to my custom remoting object from my delegate.

            Thanks