2 Replies Latest reply on Dec 28, 2011 9:00 AM by paulhart83

    Err #1009: Cannot access ... null object reference. at Application/softKeyboardDeactivateHandler()

    paulhart83 Level 1

      Here is the full error:

       

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

                at spark.components::Application/softKeyboardDeactivateHandler()[E:\dev\hero_private\framewo rks\projects\spark\src\spark\components\Application.as:1631]

       

      It then takes me to the Application.xml class file. I have no idea what's wrong but it seems to only happen during debug mode. The only results I got on google where in Chinese. Anyone know what's wrong?

        • 1. Re: Err #1009: Cannot access ... null object reference. at Application/softKeyboardDeactivateHandler()
          paulhart83 Level 1

          It takes me to the following function:

           

          private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void

              {

                  if (this === FlexGlobals.topLevelApplication)

                  {           

                      isSoftKeyboardActive = false;

                     

                      if (softKeyboardBehavior == "none" && resizeForSoftKeyboard)

                      {

                          var sm:SystemManager = systemManager as SystemManager;

                          var scaleFactor:Number = 1;

                         

                          // Account for any density scaling

                          if (sm)

                              scaleFactor = sm.densityScale;

                         

                          // Restore the original values

                          setActualSize(stage.stageWidth / scaleFactor, stage.stageHeight / scaleFactor);

                         

                          validateNow(); // Validate so that other listeners like Scroller get the updated dimensions

                      }

                  }

              }

           

           

          I really have no control over this code so it's pretty messed up.

          • 2. Re: Err #1009: Cannot access ... null object reference. at Application/softKeyboardDeactivateHandler()
            paulhart83 Level 1

            Setting resizeForSoftKeyboard="false" in the main mxml file fixed the issue