1 Reply Latest reply on May 21, 2007 3:01 PM by Newsgroup_User

    AS 3.0: Extending Event class

    MaxVT103
      I am having trouble trying to figure out how to properly extend the Event class to add parameters to events. Here is what I have. If anyone knows how to do this properly please let me know.
        • 1. Re: AS 3.0: Extending Event class
          Level 7
          You need to call super() passing the necessary information to the super
          class constructor (Event) in your custom event constructor.

          You should also override the clone event since that is used internally by
          Flash sometimes when dispatching events and an error will occur if your
          event tries to use the inherited clone

          http://www.adobe.com/devnet/actionscript/articles/event_handling_as3_07.html



          "MaxVT103" <webforumsuser@macromedia.com> wrote in message
          news:f2sfju$47k$1@forums.macromedia.com...
          >I am having trouble trying to figure out how to properly extend the Event
          >class
          > to add parameters to events. Here is what I have. If anyone knows how to
          > do
          > this properly please let me know.
          >
          >
          > package internalAssets{
          > import flash.events.Event;
          > public class DomainEvent extends Event{
          > //local variables
          > public static var COMPLETE:String = Event.COMPLETE;
          > public var domain:ApplicationDomain;
          >
          > //constructor function
          > public function DomainEvent(type:String, domain:ApplicationDomain,
          > bubbles:Boolean = false, cancelable:Boolean = false){
          > this.domain = domain;
          > }
          > }//end of class
          > }//end of package
          >