3 Replies Latest reply on Oct 7, 2009 6:50 AM by camfieldaj

    Reload SWFLoader in Flex

    Animatourboy

      Hi!

      I'm struggeling with a imported SWF-object in my Flex-app. When I shift between different states of my application, I want one of my SWFs to "reset" into initial state, so when I come back, the SWF plays again.

      So: Is it possible to make a function which can be called to "reset" or reload my SWF?

      I'm using the Flex-component SWFLoader.

      Thanks!

        • 1. Re: Reload SWFLoader in Flex
          Flex harUI Adobe Employee

          It depends on what you loaded.  Usually you see what swfLoader.content is and call appropriate methods

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: Reload SWFLoader in Flex
            Animatourboy Level 1

            Thanks for replying.

             

            SWFLoader don't have any reload-methods (or simular), so it seems like the only way to do it, is to unload the SWF when changing state, then load it back in when returning to the state which contains the SWF.

             

            As I'm just starting to learn Flex, I don't have the needed knowledge about ActionScript to pull this off.

             

            Any help in this matter would therefore be much appriciated.

            • 3. Re: Reload SWFLoader in Flex
              camfieldaj Level 1

              Okay, this is pretty much straight out of the help files:

               

              In your Application you have a function called apploader. apploader takes the name of the module you pass to it and set the url property of the moduleloader with that.

               

              In any module that gets loaded, you have a call to Application.application.apploader("someotherModule.swf") when you want to unload that module. In your case you'd get the name of the swf based on the state, right?

               

              HTH,

               

              acamfield