title: web service code in actionscript
body: <p>im calling an actionscript class from my main mxml file. the actionscript class is responsible for calling a web service and handling the response, however im having trouble and keep getting the following error; (im new to flex btw)</p>
  
  <pre><code>Error #1009: Cannot access a property or method of a null object reference.
  </code></pre>
  
  <p>my code goes as follows;</p>
  
  <pre><code>    public function getSites(argWsdl:String):void{
      ws = new WebService();
          ws.loadWSDL(argWsdl);
      ws.getSites.addEventListener(ResultEvent.RESULT,echoResultHandler); 
      ws.getSites();
  }
  
      public function echoResultHandler(event:ResultEvent):void {
          var siteField:ArrayCollection = event.result as ArrayCollection;
          Application.application.setSiteField(siteField);
      }
  </code></pre>
  
  <p>when i run the debugger the code never reaches the result hanlder and i see the #1009 error in the variable list. </p>
  
  <p>any ideas?</p>