title: How can I use addEventListener and return something that's changed from it in Actionscript?
body: <pre><code>private function getTitle(src:String):String{
              var urlLoader:URLLoader = new URLLoader();
              var rssURLRequest:URLRequest = new URLRequest(src);
              var rss:XML = new XML;
              var t:String = src;
              urlLoader.addEventListener(Event.COMPLETE, 
                                         function(event:Event):void{
                                             rss = XML(urlLoader.data);
                                             t = rss.channel.title.toString();
                                          });
              return t;
          }
  </code></pre>
  
  <p>I'm aware that this code doesn't work because the anonymous function doesn't work until after t is returned. How would I make it so that it works?</p>