7 Replies Latest reply on Oct 19, 2009 8:31 AM by emansouri

    Two Major Problems - DragManager, and Something Very Strange

    emansouri Level 1

      Hello,

       

      I am new to this forum though I have been building with the Flash Builder Beta Release for a long time now.

       

      I have somewhat of a complex scenario and I'll try to explain things as succinctly and simply as possible.

       

      I have a "main container" that is built in Flex 3 and it loads Flex 4 applications into it via SWFLoader attached to an MDI instance (using the MDI library from the flexlib library).

       

      Adobe's contention is that this configuration is unsupported, and I understand this.  It is my intention to port the Flex 3 container to Flex 4 however that is a challenge as I am using a number of compiled libraries in this container that simply don't work in Flex 4.  Also, in order to do this, I have to target Flash Player 10 when compiling the Flex 3 container.

       

      The Flex 4 apps I am loading into the Flex 3 container have a lot of features from Flex 4 I want to use which is why I am using Flex 4 in the first place.

       

      With the Beta 1 release, everything works as expected.

       

      With the Beta 2 release, two major problems emerge.

       

      I'll explain the first one as it is a bit harder to explain.

       

      Picture an MDI window instance with a Flex 4 content added to it attached to a Flex 3 container.  Now picture there are items to the right and underneath that MDI instance in the Flex 3 container.  With the Beta 2 release, those items to the right and underneath the Flex 4 content fail to receive any mouse interactivity whatsoever - no click, double click, mouseover, etc. events.  It is like the Flex 4 content continues invisibly beyond the upper right and lower left boundaries.  This does NOT occur in the Beta 1 release.

       

      Next major problem.  Now imagine there are two of these MDI Window instances with Flex 4 content loaded into them.  The Flex 4 content implements an AdvancedDataGrid implementation and the Flex 4 content is set up in such a way that they are in sibling ApplicationDomains in the same SecurityDomain as the main container.  In the Beta Release 1, this enables content to be dragged and dropped from the ADG in MDI Window 1 to the ADG in MDI Window 2.  In the Beta Release 2, as soon as the dragged item leaves the boundaries of the MDI Window where it is being dragged from, a compiler error is thrown reporting DragEvent errors.  It appears as if the DragManager is not recognizing the DragEvent that the Flex 4 content is dispatching.

       

      So I thought to myself, well I really can't submit this as a bug.  Because my configuration is unsupported by Adobe - i.e. loading Flex 4 content into a Flex 3 container.

       

      So I decided it was finally time to move in the direction of porting my Flex 3 container to Flex 4 - even though I won't be able to use a lot of the features I'd like to because I have no way to port some libraries to Flex 4.

       

      After spending all day porting the other day, sure enough, the problems I report above continue.  They have nothing to do with loading Flex 4 content into a Flex 3 container.

       

      This completely disrupts my workflow and has me continuing my main container in Flex 3, and further, rolling back to the Beta 1 release of Flash Builder for my Flex 4 apps I'll be loading into the Flex 3 container.

       

      I hope someone can provide some insight into the problems I am reporting or perhaps facilitate some recommendations.

        • 1. Re: Two Major Problems - DragManager, and Something Very Strange
          Flex harUI Adobe Employee

          Make sure your SWCs have the same version, especially DataVisualization.SWC for AdvancedDG.

           

          You might also try a simple test case with a new project to make sure you didn't forget to set a build parameter when upgrading.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

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

          • 2. Re: Two Major Problems - DragManager, and Something Very Strange
            emansouri Level 1

            Mr Harui,

             

            Thank you for your attention to this matter.

             

            I have verified that all SWFs involved are published with the same version.  Also, I went ahead and downloaded the latest nightly build and recompiled everything and all problems originally brought forward continue.

             

            Further, I'll mention that the Flex 4 SWFs that house the AdvancedDataGrid actually represent the same Application.  Multiple instances are spawned by the main container and loaded into MDI window instances with different parameters passed to them which articulate the backend data source for the AdvancedDataGrid in said SWFs.

             

            As far as a new project with a new build parameter, I am not sure I understand.

             

            As indicated, the exact same configuration and code works in the Flash Builder Beta 1 but the behavior I bring forward here is observed with the Flash Builder Beta 2.  I am not sure if there are any alternative build parameters or build configurations that could be involved here.  If this is not the case, please provide some more specific things I could look at.

             

            Also, here is the error that is encountered with the Drag problems should it be useful:

             

            TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::DragEvent@3375e971 to mx.events.DragEvent.
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\m x\core\UIComponent.as:9403]
                at mx.managers.dragClasses::DragProxy/_dispatchDragEvent()[E:\dev\gumbo_beta2\frameworks\pro jects\framework\src\mx\managers\dragClasses\DragProxy.as:356]
                at mx.managers.dragClasses::DragProxy/dispatchDragEvent()[E:\dev\gumbo_beta2\frameworks\proj ects\framework\src\mx\managers\dragClasses\DragProxy.as:343]
                at mx.managers.dragClasses::DragProxy/mouseMoveHandler()[E:\dev\gumbo_beta2\frameworks\proje cts\framework\src\mx\managers\dragClasses\DragProxy.as:493]

             


            Thank you for your continued assistance.  For the timebeing, I have rolled back to my original configuration - i.e. Flex 3 Main Container, and Flash Builder Beta 1 child SWFs though of course I am eager to move forwarding rolling everything into the same Flex 4 build but that is simply an impossibility at this time.

             

            Please let me know what I should try next to help diagnose the specific problem in the Beta 2 release.

            • 3. Re: Two Major Problems - DragManager, and Something Very Strange
              Flex harUI Adobe Employee

              In beta2, if you are using loadForCompatibility in SWFLoader, you must compile all SWFs with the MXMLC option -includes=mx.managers.systemClasses.MarshallingSupport.

               

              To improve performance, MarshallPlan classes are no longer baked into Flex applications by default.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

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

              • 4. Re: Two Major Problems - DragManager, and Something Very Strange
                emansouri Level 1

                Excellent Mr Harui.  This resolves both issues I brought forward.

                 

                Thank you, as usual, for your leadership and expertise.

                • 5. Re: Two Major Problems - DragManager, and Something Very Strange
                  emansouri Level 1

                  Mr Harui,

                   

                  I have a follow-up question here.

                   

                  It seems the compiler directive to include the Marshalling classes needs to be added to both the container and child SWFs.

                   

                  I was able to get this working with the container in its current Flex 4 port, but when I try to implement this in the Flex 3 port of the main container, it fails.

                   

                  The compiler directive doesn't work in Flex 3 and I am wondering if there is any way to get it to work in Flex 3, and when the Flex 3 container loads the Flex 4 SWF with the newly added compiler directives, the previous errors encountered still persist.

                   

                  I know the configuration of Flex 4 loading into Flex 3 is unsupported, but could you give me some insight on this nonetheless?

                   

                  I am hoping to finalize my conversion of my main container to Flex 4 ASAP but there are some crucial commercial components I am working with in my main container project (for instance the Drumbeat Insight HTML Component - http://www.drumbeatinsight.com) that I am unable to port to Flex 4 despite requests for help from the vendor.

                  • 6. Re: Two Major Problems - DragManager, and Something Very Strange
                    Flex harUI Adobe Employee

                    In Flex 3, Marshalling Support is built in so there is no additional compiler option, but as I said, Flex 3 loading Flex 4 is not supported.

                     

                    Alex Harui

                    Flex SDK Developer

                    Adobe Systems Inc.

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

                    • 7. Re: Two Major Problems - DragManager, and Something Very Strange
                      emansouri Level 1

                      I have made this a moot point.  I have finally ported my whole main container to Flex 4 and am going forward from here.  I even have the HTMLComponent from Drumbeat Insight almost fully working which was my main challenge.  All that remains are a large number of cosmetic issues.

                       

                      I appreciate your leadership and assistance here.  Unfortunately, I assure you you'll probably be hearing from me in this forum going forward.