2 Replies Latest reply on May 30, 2011 3:24 AM by ThomasJames_T

    Flashbuilder 4.5 Alert.show error

    ThomasJames_T Level 1

      My shutdown method looks like

       

          private function onShutDown(event:Event):void {
                  event.preventDefault();
                  Alert.show("Do you REALLY want to close this application?", "Wait! Don't go!", 3, null, onConfirmation);
              }

       

      And is valid but throws :

       

      [SWF] AirPureAS.swf - 985,029 bytes after decompression
      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.controls::Alert$/show()[E:\dev\hero_private\frameworks\projects\mx\src\mx\controls\Ale rt.as:566]
          at AirPureAS/onShutDown()[C:\Users\Public\Documents\workspace\study\AirPureAS\src\AirPureAS. as:64]

       

      Am I missing something. I have this setup so that the Flex project runs from a default .as class rather then default mxml application class.

      And it works fine. As long as I leave Alert.show alone...

       

       

       

      My hair is gone, my tea is cold, heeeeeelp!

       

      Thanks on beforehand

       

      Thomas

        • 1. Re: Flashbuilder 4.5 Alert.show error
          Peter Blazejewicz Level 4

          Hi Thomas,

           

          there is "wired" dependency to Flex SDK based content (that is "application" not "sprite") in Alert - so it fails when it tries to configure itself to show on screen (as there is no FlexGlobals.topLevelApplication.systemManager and this line is not coded safely - so it fails with runtime error). This is basically what your error means (just click on alert to get to source code and check 566 line of code). I assume you're using pure AS based movie in your project (extending flash.display.Sprite).

           

          hth,

          regards,

          peter

          • 2. Re: Flashbuilder 4.5 Alert.show error
            ThomasJames_T Level 1

            Yes suspected last night that must be it after starting at it in debugger.

             

            I am devicing my own alert box as a result of that, finely designed!

             

             

            Thanks

             

            Thomas