3 Replies Latest reply on Mar 11, 2011 3:46 PM by Flex harUI

    SWFLoader.unloadAndStop and then reload SWF

    JMResler Level 1

      Sorry,

          I see there are many discussions about SWFLoading but I see none that seem to answer my question. I am using FlashBuilder 4 with the 10.+ flash player in a flex application. I have other application SWF's that I dynamically load and unload at runtime. The first time I load a SWF, the loaded application works fine. After I unloadAndStop the SWF, every other application, including the one unloaded refuses to respond. I've read the documentation on unloadAndStop and see that it removes the listeners from the unloaded SWF. I am trying to determine how to switch through the SWF's without losing the ability to interact with them. Does anyone have any ideas? Perhaps something I'm doing wrong with the unloading? Here is some example code:

       

       

      var applicationLoader:SWFLoader = new SWFLoader();

       

       

      private function loadApp(appName:String) : void

      {

           if (appName == "Admin")

           {

               applicationLoader.load("Admin.swf");

          }

       

      }

       

      private function unloadApp() : void

      {

           applicationLoader.unloadAndStop(true);

      }