I need to use super() in a handler function but AS3 won't let me!

Hi all, sorry for my english (i’m from Italy)

I’m trying to make a CustomLoader class that extends another class.
In the contructor of my CustomLoader, i need to call super(myLoader:Loader) where myLoader is a Loader
object. Problem is I need to listen to the complete event of the loader before passing it or i’ll get an “Error #1009: Cannot access a property or method of a null object reference”. but if i put super() in a handler function i get an “Error 1007 : A super statement can be used only inside class instance constructors.”

Do you have any idea how to solve this problem?

Here’s part of my code:

public class CustomLoader extends ParentClass
{
       ...


     public function CustomLoader():void
    {
         var url:URLRequest = new URLRequest("somemovieclip.swf");
         var myLoader = new Loader();
         myLoader.load(url);
         super(myLoader); // <----------- this gives error #1009
          myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function ()
         {
              super(myLoader); <-------- this gives error #1007
         }
          );
     }
}

Any help will be highly appreciated :flower: