9 Replies Latest reply on Nov 3, 2009 4:48 AM by jake_flex

    SystemManager.as : 'should never get here' when uploading multiple files

    jake_flex Level 2

      I have a code for uploading multiple files. The code works so that when complete event from the first upload is received, the second upload is started. The code works fine on Flash Player 9, but now when I changed my compiler settings to require version 10, the program no longer works.

       

      Also this only seems to occur when I execute the code from the Flash Builder. I have compiled the code with ant requiring FP version 10. This swf is bundled inside a war and can executed without any problems. I actually set the ant compiler to require FP 10 some time ago already.

       

      I get error 2174, which is for trying to upload multiple files at the same time. Although, I don't understand why I get this, since the uploads should not be done simultaneously as I explained above.

       

      The interesting thing here is when I try to debug it. At some point when stepping in the code, I get the following error thrown. It's thrown by the code pasted at the end. Interesting is the else block that throws the error, the comment says 'should never get here'.

       

      A bug in the framework or in Flex Builder?

       

      Using IE 8 with FP 10.0.32.18 (on Win XP if that matters).

       

      Thanks.

       

      Error
           at mx.managers::SystemManager/updateLastActiveForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:5087]
           at mx.managers::SystemManager/activateForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2352]
           at mx.managers::SystemManager/activate()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2307]
           at mx.managers::FocusManager/creationCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:1592]
           at flash.events::EventDispatcher/dispatchEventFunction()
           at flash.events::EventDispatcher/dispatchEvent()
           at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
           at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
           at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
           at Function/http://adobe.com/AS3/2006/builtin::apply()
           at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
           at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
      
           private function updateLastActiveForm():void
           {
                // find "form" in the forms array and move that entry to
                // the end of the array.
                var n:int = forms.length;
                if (n < 2)
                   return;     // zero or one forms, no need to update
                   
                var index:int = -1;
                for (var i:int = 0; i < n; i++)
                {
                   if (areFormsEqual(form, forms[i]))
                   {
                        index = i;
                        break;
                   }
                }
               
                if (index >= 0)
                {
                   forms.splice(index, 1);
                   forms.push(form);
                }
                else
                   throw new Error();     // should never get here
               
           }