4 Replies Latest reply on Jun 29, 2010 7:17 AM by Florincugir

    addEventListener

    Florincugir

      Hi,

       

      I have one Flex application ("Host") calling another Flex application ("Called"); this operation is performed using SWFLoader module:

       

      <mx:SWFLoader

       

       

      id="ShipmentDetails" height="100%" width="100%" horizontalCenter="0" verticalCenter="0"

      showBusyCursor=true" autoLoad="false" creationComplete="uploadFile=true; uploadSWF();" init="initHandler(event)"/>

       

      The functions used are:

       

       

       

       

       

       

      private function uploadSWF():void

      {

       

       

           if (uploadFile == true)

           {

       

                var url:Object = 'http://syyzas400/ShipmentInquiry/ShipmentDetails.swf';

                ShipmentDetails.load(url);

           }

      }

       

       

      private function initHandler(event:Event):void

      {

      event.currentTarget.content.addEventListener(FlexEvent.APPLICATION_COMPLETE, appComplete)

      }

       

       

       

      private function appComplete(event:Event):void

      {

      event.currentTarget.application.setParameter(userSession);

      }

       

       

      As you can see, I am trying to pass a parameter (userSession) to the called application (see appComplete function). The problem I have is that this parameter is passed too late; I think this is because the EventListener is listening for APPLICATION_COMPLETE event (see function initHandler). I tried to put any other events (INIT_COMPLETE, INITIALIZE, PREINITIALIZE, etc) but it looks nothing works, but APPLICATION_COMPLETE 

       

      I actually need to have the parameter passed when the called application starts to run (based on this value I apply or not a blur effect on some components of the called application).

       

      Any help would be greatly appreciated.

       

      Thanks.