4 Replies Latest reply on Oct 15, 2009 12:42 PM by TobySG

    System Manager error during preload

    1ndivisible Level 1

      Hi,

       

      Since updating to 3.4 I am getting an intermittant RTE during my application's preloading.

       

      The error is:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      at mx.managers::SystemManager/stageEventHandler()[C:\autobuild\galaga\frameworks\projects\fr amework\src\mx\managers\SystemManager.as:5649]

       

      It occurs in the SystemManager here:

       

      /**
      *  @private
      *  dispatch certain stage events from sandbox root
      */
      private function stageEventHandler(event:Event):void

      {
           if (event.target is Stage)
                   mouseCatcher.dispatchEvent(event);
      }

       

      The Event type is MOUSE_MOVE.

       

      As far as I'm aware I can't override the SystemManager, so how can I get around it?

       

      Thanks.

        • 1. Re: System Manager error during preload
          1ndivisible Level 1

          Never mind. I seem to have sorted it.

           

          Created a custom preloader and listened for ADDED_TO_STAGE.

           

          In the handler:

           

          stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, true );

           

          Then in the onInitCompleteHandler();

           

          stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, true );

          • 2. I'm seeing the same thing
            bpja

            This function clearly needs a fence

             

                private function stageEventHandler(event:Event):void

                {

                    if (event.target is Stage)

                        mouseCatcher.dispatchEvent(event);

                }

             

            Can you elaborate on what you did with a custom preloader to eliminate the problem? Did you cancel the event?

             

            This is a new problem with 3.4.1

            • 3. Re: I'm seeing the same thing
              1ndivisible Level 1

              Hi,

               

              Yep. Its a bug with 3.4. (Ironically I updated from 3.3 to duck another bug, but so it goes). Actually, I never fully solved it as far as I remember. It still seemed to pop up once in awhile, though I think I minimised it a lot.

               

              In the Preloader I listened to Event.ADDED_TO_STAGE, then in the handler:

               

              Tried:

               

              stage.mouseEnabled = false; // Throws RTE saying stage Stage doesn't impliment this property.

               

              So did:

               

              graphics.beginFill(0xFF0000,0);
              graphics.drawRect(0,0, 1000, 1000); // Could be more accurate but this was fine for me.
              mouseEnabled = false;

               

              - Basically drew a shield in the preloader to bounce away mouse interaction and prevent MouseEvents reaching the stage (And causing the error).

               

              Like I said. Seeemed to help, but never resolved it fully. TBH it was right at the end of a project which has since passed through QA, so must have been very intermittant.

               

              Let me know if the above helps & if you find a better solution.

               

              Good luck.

              • 4. Re: System Manager error during preload
                TobySG

                Looks like a lot of us are going to run into this one. Just for reference, here's the bug concerned:

                http://bugs.adobe.com/jira/browse/SDK-23332