1 Reply Latest reply on Sep 25, 2008 8:36 PM by Newsgroup_User

    Sporadic error message

    SiHoop Level 1
      I'm creating an application that uses the Google Maps api. When I run my file I get an error message about 50% of the time. I'm using a UIComponent to display my map, and the UI tag has a resize event handler. The error message indicates that the event handler doesn't exist, but the handler does exist-- moreover, it works half the time! Am I attempting to use the event handler before it has been created is there there some other problem that I'm not aware of?
        • 1. Re: Sporadic error message
          Level 7

          "SiHoop" <webforumsuser@macromedia.com> wrote in message
          news:gbhjtu$q7i$1@forums.macromedia.com...
          > I'm creating an application that uses the Google Maps api. When I run my
          > file I
          > get an error message about 50% of the time. I'm using a UIComponent to
          > display
          > my map, and the UI tag has a resize event handler. The error message
          > indicates
          > that the event handler doesn't exist, but the handler does exist--
          > moreover,
          > it works half the time! Am I attempting to use the event handler before it
          > has
          > been created is there there some other problem that I'm not aware of?
          >
          > Error message:
          > TypeError: Error #1009: Cannot access a property or method of a null
          > object
          > reference.
          > at GT5/resizeMap()[C:\Documents and Settings\sxh12\My Documents\Flex
          > Builder
          > 3\GT3\src\GT5.mxml:154]
          > at GT5/__mapContainer_resize()[C:\Documents and Settings\sxh12\My
          > Documents\Flex Builder 3\GT3\src\GT5.mxml:31]
          > at flash.events::EventDispatcher/dispatchEventFunction()
          > at flash.events::EventDispatcher/dispatchEvent()..........
          >
          > Code:
          > <mx:HBox width="100%" height="100%" id="mapLayout2" x="305">
          > <mx:UIComponent id="mapContainer" initialize="startMap(event);"
          > resize="resizeMap(event)" width="100%" height="100%"/>
          >
          > </mx:HBox>

          That looks like it's an error being generated when it is trying to dispatch
          the event, since it is coming from inside dispatchEvent. What's the code in
          the two event handlers referenced in that UIComponent line?