title: custom AS3 Loader class that uses a custom LoaderInfo class?
body: <p>This is a question specifically about creating a custom Loader class as a followup to <a href="https://stackoverflow.com/questions/758322/how-do-i-modify-existing-as3-events-so-that-i-can-pass-data">How do I modify existing AS3 events so that I can pass data?</a>. If this wasn't the right way to go about this, let me know.</p>
  
  <p>I have a custom Loader class and a custom LoaderInfo class. What I can't figure out is how to have the Loader class use the custom LoaderInfo class as it's contentLoaderInfo property.</p>
  
  <pre><code>package com.display {
      import flash.display.Loader;
  
      import com.display.CustomLoaderInfo;
  
      public class CustomLoader extends Loader {
          public var customData:*;
  
          public function CustomLoader(passedData: *= null) {
              customData = passedData;
          }
      }
  }
  </code></pre>
  
  <p>^ Have to do something in there to make it have the new CustomLoaderInfo</p>
  
  <pre><code>package com.display {
      import flash.display.LoaderInfo;    
      import flash.events.Event;
  
      import com.events.CustomEvent;
  
      public class CustomLoaderInfo extends LoaderInfo {
          public var customData:*;
  
          public function CustomLoaderInfo(passedData: *= null) {
              customData = passedData;
          }       
  
          override public function dispatchEvent(event:Event):Boolean {
              var customEvent:CustomEvent = new CustomEvent(event.type, customData, event.bubbles, event.cancelable);
              return super.dispatchEvent(customEvent);
          }
      }
  }
  </code></pre>
  
  <p>^ That might work, but since I can't get CustomLoader to use it, I don't know yet.</p>