title: How to make a event Listener function return a value? How to track the response from listener function?
body: <p>I tried to write a class which will return me a json object for the given string. I know the syntax for the code below is completely wrong but just tried to do this.</p>
  
  <pre><code>package com 
  {
      import flash.display.MovieClip;
      import com.adobe.*;
      import com.adobe.serialization.json.JSON;
      import flash.net.dns.AAAARecord;
      import flash.net.URLRequest;
      import flash.events.Event;
  
      public class getJson extends MovieClip
      {
  
          public function getJson(urlString:String):Object
          {
              // constructor code
              var returnObject:Object = new Object();
              var urlLoader:URLLoader = new URLLoader();
              returnObject=urlLoader.addEventListener(Event.COMPLETE,loadingComplete);
              urlLoader.load(new URLRequest(urlString));
              return returnObject;
  
  
          }
  
          private function loadingcomplete(e:Event):Object
          {
              var jsonObject:Object = new Object();
              jsonObject=JSON.decode(urlString);
              return jsonObject;
          }
  
      }
  
  }
  </code></pre>