title: as3 return value on loader complete
body: <p>I am trying to get my function to return a value from a php script once it has loaded. I am having issues with the 'return' aspect. Trying to the the value of 'TheLink" from a function with a 'return' in it. It's usually null. What am I doing wrong here?</p>
  
  <pre><code>var theLink = loadAudio();
  
  public function loadAudio():String
    {
    var req:URLRequest = new URLRequest("myScript.php");
    var loader:URLLoader = new URLLoader(req);
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, Finished);
  
      function Finished(e:Event)
        {                 
        var theValue = JSON.parse(e.target.data.audioLink);
        return theValue;
        }                     
     }
  </code></pre>