3 Replies Latest reply on Apr 28, 2011 9:26 AM by Drew747

    loading flex swf from flash

    Level 2

      Have struggled with this for years. I have a website that is Flash authored and it loads Flash swfs a.k.a. AS3 swfs no problem. There was always the non supported take from Adobe that disallowed Flex swfs to be loaded in these environments. SystemManager from flex wants to be the only SystemManager.

       

      reference this:

       

      http://stackoverflow.com/questions/2354612/how-to-load-flex-swf-from-flash

       

      which came from here:

       

      http://troygilbert.com/2009/05/loading-flex-based-swfs-in-as3-only-swfs/

       

      no luck with it.

       

      has anyone succeeded in getting Flex 4 FB4 swfs to load inside of Flash parents ?

        • 1. Re: loading flex swf from flash
          drkstr_1 Level 4

          All I did was copy and paste the 6 lines of code in that link you gave, and it worked exactly like they said it would. I am loading a complex Flex app that uses modules, RSLs, and all sorts of fun stuff...

           

          I am using Flex 4.5 Hero preview release.

           

          Mind giving more detail about the specific problem your having?

          • 2. Re: loading flex swf from flash
            Level 2

            the template i am using has thousands of lines of code in total and mostly in the timeline from Flash. So I am trying to add some debug output to see if it hits my event handler.

             

            the template reference is below.

             

            http://activeden.net/item/as3-xml-driven-deep-linking-flash-website-template/119224

             

            click on the Black box to run a demo of it.

             

            It is a nice platform for multimedia content and embedding swfs. for instance you can have

             

            1) a gallery of swfs with picture thumbs and launch them as popups

            2) a content page with a fixed swf   (see the News menu item and scroll down to the item at the bottom)

            3) or a slideshow of swfs.

             

            I would not do #3 as my swfs are data driven apps with back end sql server interfaces and that would not be suitable.

             

            it is all xml driven for the faint of heart but fortunately I can recompile the source code in Flash CS5 without any missing pieces. I mean it has probably 10 to 15 thousand lines of code. I do everything in classes in .as not in the timeline so my head always spins when i get these types !

             

            i will try harder to figure it out and let you know.

             

            and thank you.

             

             

             

            Date: Wed, 27 Apr 2011 17:33:55 -0600

            From: forums@adobe.com

            To: drewpierce@live.com

            Subject: loading flex swf from flash

             

            All I did was copy paste the 6 lines of code in that link you gave, and it worked exactly like they said it would. I am loading a complex Flex app that uses modules, RSLs, and all sorts of fun stuff...

             

            Mind giving more detail about the specific problem your having?

            >

            • 3. Re: loading flex swf from flash
              Level 2

              a quick chunk of the Flash CS5 code that launches the 3 tests:

               

              http://pastie.org/1843765

               

              you can see the 3 tests but only 1 live at any given attempt of course.

               

              the 1st test is the one i care about as it is a data driven wcf test against an amazon ec2 cloud instance with sql server. the wcf server and sql are on that box whereas the html that gets your there is elsewhere from a different host but the crossdomains are set up fine. click on wide receivers and Memory or DB. brings back data from sql server.

               

              The *native* Flex 4 version of it is sitting here that is not called up from a Flash swf loader and it works fine:

              http://www.teamvisionboston.com/site2/wcf_client_test.html

               

              when test 1 is loaded from a Flash website it generates this error:

               

              error01.JPG

               

              you can see myList at the far right that shows it receives the swf load attempt and the 2 events at systemManagerHandler. This pretty much blows up anything that follows.

               

              Test 2 is a new simple FB4 build with a label and button. that is it. it generates a different error but at least trying to see if there is some issue with just wcf or rpc from test 1 that would not occur here. It too shows the same 3 events in the debug listbox. Debug meaning a release versions using Listbox.addItem(). It runs fine at http://www.teamvisionboston.com/site2/asdf.html

              unless of course like i said you load it from Flash.

               

              Test 3 is the current live version up there at

              http://www.teamvisionboston.com/site2

               

              that loads a generic swf. It of course gets the first load debug message but because it is not from Flex not the last 2. And that works.

               

              so I am at a loss.