4 Replies Latest reply on Aug 16, 2006 12:24 PM by KenichiM

    Controlling loaded/embeded SWF file

    KenichiM
      Is there a way to load or embed a SWF file and control the SWF using its play, stop, and gotoAndPlay methods. The Flex image and SWFLoaders do not expose these methods. The FlexMovieClip and MovieClipAsset however do but are not UIComponents and throw and exception when you attempt to add them into another UIComponent.
        • 1. Re: Controlling loaded/embeded SWF file
          peterent Level 2
          Follow the instructions in this TechNote: Using Flash 8 SWFs in Flex 2 Applications.
          • 2. Re: Controlling loaded/embeded SWF file
            KenichiM Level 1
            Thanks. So when Flash 9 is shipped, using LocalConnection will no longer be necessary? Meanwhile, will there be a way to compile an FLA file for the Flash 9 player?

            On another note, it sound like using a Flash 8 movie is expensive. Is the recommendation to avoid embedding Flash 8 movies when possible, like creating these movies/animations using Flex components instead of using Flash 8?
            • 3. Re: Controlling loaded/embeded SWF file
              peterent Level 2
              I am fairly certain that is the way it will be. Afterall, if you compile a Flex 2 app into a SWF and load it via SWFLoader you do have direct access to its contents. I don't think Flash 9 would make that any different, but I'm 100% certain.

              Personally, I think LocalConnection is preferrable. It keeps the two separated and forces you to make a good interface between them.

              I also do not think using a SWF8 is any more expensive. If you can more easily develop what you need in Flash than Flex, that's also an expense to take into consideration. On the other hand, maintaining Flash code is more difficult than Flex code due to the fact that you need to know the Flash IDE.
              • 4. Re: Controlling loaded/embeded SWF file
                KenichiM Level 1
                I re-published the SWF files using the Flash 9 Preview (targeted for Flash 9 Player), but can't seem to load the movies using the mechanism used to load other Flex 2 apps (i.e. System Manager). Is there another preferred way that I can load the SWF movies and access their methods (mainly play, stop, gotoAndPlay)?.

                One of the big annoyanes with Local Connection, especially during development, is that that you cannot run multiple instances, or the local connection name has to be unique across the multiple instances of the Flex app.