>just can't think of one now.

The most common case where you do not extend the EventDispatcher is when you
need to extend the Proxy class in order to catch dynamic method and property
calls. In that case
you need to extend a class that does not extend EventDispatcher itself
you can do something like this:

public class Test extends Proxy implements IEventDispatcher
{
   private var _eventDispatcher:EventDispatcher;

   public function Test()
   {
      _eventDispatcher = new EventDispatcher(this);
   };

   public function dispatchEvent(event:Event):Boolean
   {
      return _eventDispatcher.dispatchEvent(event);
   };

  public function addEventListener(type:String, listener:Function,
useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean =
false):void
   {
      return _eventDispatcher.addEventListener(type, listener, useCapture,
priority, useWeakReference):void
   };

   ...

};


Greetz Erik


On 1/29/08, Guybrush Threepwood <[EMAIL PROTECTED]> wrote:
>
> Thank you again!
> I can't think of a reason not to extend EventDispatcher. I think most
> classes in AS3 seem to be a subclass of it.
> I'm sure there must be cases where you can't just extend EventDispatcher.
> I
> just can't think of one now.
>
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to