2 Replies Latest reply on Mar 9, 2007 11:37 AM by ntsiii

    Error 1009 on HTTPService ResultEvent

    PitySOFT
      Hello guys.

      I have a list of HTTPServices. And some of them execute one after other. After the first request I get this error but only in IE 6. In IE 7 and FF 2 works perfectly.

      TypeError: Error #1009: Cannot access a property or method of a null object reference. at run/::v_response() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent() at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::resultHandler() at mx.rpc::Responder/result() at mx.rpc::AsyncRequest/acknowledge() at ::DirectHTTPMessageResponder/completeHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/flash.net:URLLoader::onComplete()

      The error came from this line

      videoListScroll.dataProvider = videoList.lastResult.response.videos.video;

      It seems that on IE 6 and Opera, "videoList.lastResult.response.videos" is not an object, is null. But on IE 7 it's an object and is the same code.

      Any ideea why?
        • 1. Re: Error 1009 on HTTPService ResultEvent
          chris.huston.t10 Level 3
          What is the code that you are using to call your HTTPServices? It looks like that Flex has not yet received the result from a service call at thte time that it tries to assign the result to the dataProvider. You should be able to prevent this error by chaining your service calls with result events. If possible, post your code that calls the videoList service and also the function where the videoListScroll dataProvider is assigned.

          Vygo
          • 2. Re: Error 1009 on HTTPService ResultEvent
            ntsiii Level 3
            Yes. You can simplify this by using a single HTTPService. Use an AsyncToken to identify the call and to route processing when it returns.

            Do not use lastResult in AS code, it is intended for binding expressions. Instead use a handler to assign the data to a [Bindable] instance variable, and reference or bind to that.

            Tracy