I never use super() so I have no idea, but see what happens when you throw
the initialize in a static variable like;


class myClass extends otherClass
{
        private static var EventDispatcherDependancy  =
mx.events.EventDispatcher.initialize ( myClass.prototype );
        public var addEventListener:Function;
        public var removeEventListener:Function;
        public var dispatchEvent:Function;

        public function myClass (m:Model) {
                super();
        }
}

_____________________________

Jesse Graupmann
www.jessegraupmann.com 
www.justgooddesign.com/blog/ 
_____________________________



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
Jason
Sent: Friday, June 08, 2007 4:31 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] AS2: EventDispatcher.initialize() and
super()conflict?

I have a class that has to call it's superclass in the constructor.
However, it also needs to initialize EventDispatcher to listen to
dispatch events that another class is listening to.  It seems, and I
could be wrong, that EventDispatcher does not work if it's not the first
thing in the constructor.  I thought someone had said once, or I read
it, that EventDispatcher has to be first in the constructor.  And of
course, probkem then is super() will not work if it's not first, so it
seems to be a catch-22.  Is this true regarding
EventDispatcher.initialize() and how to avoid?

code snippet:

           /*=========Constructor=========*/
        public function MyClass(m:Model)
        {
                super(m);
                EventDispatcher.initialize(this);
        }

If this is OK then maybe something else is wrong in my code, I just
wanted to find out if maybe this is why the events aren't firing.  

Thanks,


Jason Merrill
Bank of America  
GT&O Learning & Leadership Development
eTools & Multimedia Team

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to