3 Replies Latest reply: Jun 12, 2009 4:08 AM by Ziggizag RSS

    Custom ProgressEvent problem - HELP !!!

    Ziggizag Community Member

      Hi People,

       

      Is there anybody helpful enough to explain me why the following class is working prefectly:

       

      CustomEvent:

       

      package

      {
           import flash.events.Event;
           public class CustomEvent extends Event

           {

                public static const COMPLETE:String = "COMPLETO";
                public var argumento:*;
                public function CustomEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)

                {
                     super(type, bubbles, cancelable);

                }
                override public function clone():Event

                {
                     var evento:CustomEvent = new CustomEvent(this.type, this.bubbles, this.cancelable);
                     return evento;
                }
           }

      }

       

      while this class is failing with "1023: Incompatible override" error:

       

      CustomProgressEvent:

       

      package

      {
           import flash.events.ProgressEvent;
           public class CustomProgressEvent extends ProgressEvent

           {
                public static const PROGRESS:String = "PROGRESSO";
                public var argumento:*;
                public function CustomProgressEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0)

                {
                     super(type, bubbles, cancelable);

                }
                override public function clone():ProgressEvent

                {
                     var evento:CustomProgressEvent = new CustomProgressEvent(this.type, this.bubbles, this.cancelable, this.bytesLoaded, this.bytesTotal);
                     return evento;
                }
           }

      }

       

      Any ideas why can't I override the default constructor in case of ProgressEvent?

      It is urgent  - please...

       

      Regards,

      Ziggi