9 Replies Latest reply on Nov 25, 2009 6:38 AM by rexdtripod

    Strange LayoutManager error when loading external swf

    rexdtripod

      The swf loads and I get no popup errors in the browser.  But in debug mode my FlexBuilder console reads:

       

      [SWF] C:\~projects\source\flexbuilder\tests\dyvetntive_moderator_test\bin-debug\assets\swf\pres entation.swf - 1,592,516 bytes after decompression
      undefined
          at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:668]
          at Function/http://adobe.com/AS3/2006/builtin::apply()
          at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]
          at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]

       

      Loading other swf's produces the same result.

       

      What is that?

        • 1. Re: Strange LayoutManager error when loading external swf
          Flex harUI Adobe Employee

          Do you have a SWF that is loading these SWFs?  Is the SWF that is doing the loading compiled with 3.2 or later?  This might happen if you have incompatible versions.  Only 3.2 or newer SWFs can load a 3.2 SWF.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

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

          • 2. Re: Strange LayoutManager error when loading external swf
            rexdtripod Level 1

            It's a Flex application compiled with SDK 3.2.  Should be no problem in that regard.

             

            Very odd error.

            • 3. Re: Strange LayoutManager error when loading external swf
              Flex harUI Adobe Employee

              I guess I would start comparing against simple test projects.  Take two new 3.2 projects, have one load the other, then build up towards your current projects until you get the error and/or comment stuff out of your projects until you get success.

               

              If you are using RSLs, try using static linking and see if that makes a difference.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

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

              • 4. Re: Strange LayoutManager error when loading external swf
                rexdtripod Level 1

                Not sure if I'm reading you correctly here.  Let me clarify.

                 

                Not using RSL's.  I'm also not including another Flex app into my main Flex app.  It's actually a Flash slide show swf.  Are you saying I should just create another Flex app, compile, and pull into my Flex app?

                • 5. Re: Strange LayoutManager error when loading external swf
                  rexdtripod Level 1

                  Again, not sure what you mean here.  Could you clarify?

                   

                  There is no "build up towards your current projects until you get the error and/or comment stuff out of your projects until you get success".  When I comment out the line that loads the swf, no errors are reported.  When I comment in the line that loads the swf, I get the error.

                   

                  The SWF I'm trying to load is generated by a third party product.  It's a slide show.  The swf loads and plays fine in a flash player.  Just get the error when I load it into my Flex app.  Guess it's possible the third party swf could be the issue but why would it load and play fine in a flash player?

                   

                  The console message really isn't of much help.  Just says "undefined" and points to a simple call to validateSize() in the LayoutManager.as file.  A method call undefined?  Wierd.

                  • 6. Re: Strange LayoutManager error when loading external swf
                    Flex harUI Adobe Employee

                    If the presentation.swf is an AS3 SWF that uses older versions of LayoutManager it will be incompatible with your main application SWF.  You could try to load it into its own ApplicationDomain.  Try setting loadForCompatibility=true on the SWFLoader.

                     

                    The release player does not stop on exceptions.  Only the debugger player does.  This exception is probably always being thrown, but the release player just ignores it and tries to continue.  It is possible that this exception doesn't cause more major problems and won't hurt folks using release players.

                     

                    Alex Harui

                    Flex SDK Developer

                    Adobe Systems Inc.

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

                    • 7. Re: Strange LayoutManager error when loading external swf
                      rexdtripod Level 1

                      Hmmm..  Has turned into quite a difficult proposition.  I believe your assessment of older vs newer LayoutManagers is correct.  Unfortunately the presentation.swf is the product of a third party conversion tool (PPT to Flash converter) that comes with its own SDK for hooking into it and it's own loader mechanism (no SWFLoader).  I don't see any exposed compatibility settings in their code.

                       

                      I've written them about it but as of yet no response.

                       

                      Seems like quite a gaping hole this LayoutManager backwards compatiblity situation.  Short of the third party company updating their converter tool I think I'm kind of dead in the water unless there are some LayoutManager experts out there with a tip or trick in this regard.

                       

                      I tried one guy's suggestion - wrapping the presenter swf in another Flex 3.2 app before loading but no dice.

                      • 8. Re: Strange LayoutManager error when loading external swf
                        Flex harUI Adobe Employee

                        You want to verify which version of LayoutManager they are using.  If you're lucky it will be newer than 3.2 and then you can try to upgrade your SDK to match.  If it is older, you could try wrapping the loading of presentation.swf with an app of the same version of Flex that matches and hope you don't run into issues, but you probably will.  Another approach would be to get the source for their loader and find a way to set a loaderContext on it, but even that is not guaranteed to work.

                         

                        Alex Harui

                        Flex SDK Developer

                        Adobe Systems Inc.

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

                        • 9. Re: Strange LayoutManager error when loading external swf
                          rexdtripod Level 1

                          Turns out it's probably a bug:

                           

                          http://bugs.adobe.com/jira/browse/FB-24339

                           

                           

                          Third party vendor wrote:

                           

                          We have researched this issue. It's not an issue of ours. The crash happens when the loaded AS2 Movie uses _quality property of the MovieClip object.

                           

                          Step 1 to reproduce the issue.
                          Create a simples AS2 file with Adobe Flash Studio which has the only line:

                           

                          this._quality = "BEST"

                           

                          and publish this Flash file into "QualityBug.swf" file.

                           

                          Compile the following application with Flex. As you can see there is no code of ours at all:

                           

                          Code:
                          <?xml version="1.0" encoding="utf-8"?>
                          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="onInit()">
                             <mx:Script>
                                <![CDATA[
                                   import mx.core.UIComponent;
                                   import flash.display.Loader;
                                   import flash.net.URLRequest;
                                  
                                   private function onInit():void
                                   {  
                                      var loader:Loader = new Loader;
                                     
                                      var container:UIComponent = new UIComponent();
                                      container.addChild(loader);
                                      this.addChild(container);
                                     
                                      var request:URLRequest = new URLRequest("QualityBug.swf");
                                      loader.load(request);
                                   }
                                ]]>
                             </mx:Script>
                            
                          </mx:Application>

                           

                          Launch this application in debug mode. The same crash. This means that issue is related to Adobe product family.

                           

                          We will try to report to Adobe about this issue.

                           

                          Since the issue happens only when debugging on IE we may recommend using other web browser for these purposes, for example Firefox until Adobe fix the problem with their product.