title: Combining URLRequest, URLLoader and Complete Event Listener In Actionscript 3.0?
body: <p>when handling data, i always have to write the following:</p>
  
  <pre><code>var dataSourceRequest:URLRequest = new URLRequest("/path/file.xml");
  var dataSourceLoader:URLLoader = new URLLoader(dataSourceRequest);
  dataSourceLoader.addEventListener(Event.COMPLETE, handleDataSource);
  </code></pre>
  
  <p>while i can understand the usefulness of these 2 objects and event listener being separate, since they often work with each other i'd like to know if there is a method that will combine them all?  the closest i can get is this, but it's a bit pointless/nesting:</p>
  
  <pre><code>var dataSourceLoader:URLLoader = new URLLoader(new URLRequest("/path/file.xml"));
  dataSourceLoader.addEventListener(Event.COMPLETE, handleDataSource);
  </code></pre>
  
  <p>what i'd really love would be something that automatically combines the URLRequest, URLLoader and completed event listener like this:</p>
  
  <pre><code>var dataSource:Whatever = new Whatever("/path/file.xml", handleDataSource);
  </code></pre>