Request.Wait.Load.
I’ve Never Been Clever ‘Cause Need It Never ÂÂ
This has been a major issue for me for a very long time, and now i see that many people are having the same problem.
 This is what i wanted to do:
- Flex calls a url request to webFocus, which make me a brand new XML file.
- Flex waits for the status of 200(OK)  (or else you get errors saying that the XML does not yet exist)
- Flex loads the XML.
- Voila!
here is a bit of my source code (all the main parts that you’ll need to get your app to work)
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”
 backgroundGradientColors=”[#ffffff, #ffffff]“ width=”100%” height=”100%” horizontalAlign=”center”
 verticalAlign=”middle” creationComplete=”init()” >
 <mx:Script>
  <![CDATA[
   import mx.controls.Alert;
   import mx.rpc.events.FaultEvent;
   import mx.rpc.events.ResultEvent;
   import mx.managers.CursorManager;
   ÂÂ
      private function init():void
     {
as soon as the app loads i set the BusyCursor on ON, so that the user can't click on anything before it's ready for him to click.
      CursorManager.setBusyCursor();
call the function that will send the reuqest to WebFocus (or wherever) for the XML to be created
       HTTPStatusEventExample();    ÂÂ
     }
    ÂÂ
     public function HTTPStatusEventExample():void
        {
       ÂÂ
           var loader:URLLoader = new URLLoader();
           configureListeners(loader);
          ÂÂ
           var request:URLRequest = new URLRequest("http://myurl.com/willcreate/theXML.html");
           try
           {
               loader.load(request);
           } catch (error:Error)
           {
               trace("Unable to load requested document.");
           }          ÂÂ
          ÂÂ
       }
      private function configureListeners(dispatcher:IEventDispatcher):void
      {
there are many many more EventListeners to add here, but all i needed here were these two
           dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
           dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
       }
   ÂÂ
       private function ioErrorHandler(event:IOErrorEvent):void
       {
           trace("ioErrorHandler: " + event);
       }
       private function httpStatusHandler(event:HTTPStatusEvent):void
       {
this will get executed when the status of the requested url is 200 (or complete)
           trace("httpStatusHandler: " + event);
           trace("status: " + event.status);
this is where you acutally send my XML HTTPServices in
      FEX.send();
obviously remove the busy cursor and enable your buttons or whatver else you disables, so the user can click again
   CursorManager.removeBusyCursor();    ÂÂ
   btnSubmit.enabled=true;    ÂÂ
   btnHelp.enabled=true;
       }
   your other functions, blah blah blah....
             ÂÂ
                      ÂÂ
  ]]>
 </mx:Script>
<mx:HTTPService id=”FEX” url=”FEX.xml” resultFormat=”e4x”
 result=”quickResultHandler(event);” fault=”quickFaultHandler(event);”/>
your components and stuff. blah blah blah…  ÂÂ
</mx:Application>
hope this helps!!!
 comments are appreciated
Hey nice !!!! please send me complete example ..
tks
Ric,
i did this for work and the URLs that i’m calling are secure, so it will not work for you.
however, if you have any more questions i’d be glad to help you out (as much as i can )