3 Replies Latest reply on Feb 1, 2007 11:43 AM by Chris River

    Unloading swf

    edkoch
      After using the SWFLoader to load an external swf file and start playing it (i.e. swf content from youtube) how do you unload the swf file and delete its contents so that it no longer exists and stops playing?
        • 1. Re: Unloading swf
          Hugo_Core Level 1
          How u doing edkoch..

          Have you consider trying to clear the url provider of the SWFLoader ?

          swf.url = '';

          Try play with the visible and enable syntaxes too..

          It's an idea :P

          Core, regards..
          • 2. Re: Unloading swf
            edkoch Level 1
            Core,

            Thanks for the reply, but I don't think there is a url property in SWFLoader. If you mean the "source" property then yes I have tried to change that to both null and "". I have also played with the enabled flag which according ot the documentation only effects the user interaction.

            I have also tried to dereference the SWFLoader hoping the gabage collector would delete it. I can make it invisible by setting visible=false, but the content that was loaded by the SWFLoader continues to play because I can still hear it.

            I suspect that once the SWFLoader has loaded the content then the player starts execuiting it and the loader no longer has any control over the content.

            Is there any way to eliminate or stop the content that was loaded by the SWFLoader so that it is if it never existed? Are there methods on the content itself that can be used to control it? Perhaps methods on the stage? Id like to be able to close and/or delete the content so I can dynamically load a different set of content.
            • 3. Unloading swf
              Chris River
              It's a hack, but if you create an empty swf file and load that into the same SWFLoader you should be golden.

              I'd love to be able to unload like you can a module, but I haven't found a way to do it gracefully.