Why would you extend MovieClip and composition a MovieClip as well? Seems a
bit redundant, no?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrick
Matte | BLITZ
Sent: Tuesday, April 24, 2007 7:09 PM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] Class for movie - best practice question

Try this class. Put new ApplicationClass(this); on the first frame of
the timeline.

import mx.events.EventDispatcher;

class ApplicationClass extends MovieClip{
        
        public var addEventListener:Function;
        public var removeEventListener:Function;
        private var dispatchEvent:Function;

        public function ApplicationClass(target){
                target.__proto__ = __proto__;
                this = ApplicationClass(target);
                EventDispatcher.initialize(this);
                init();
        }

        private function init(){
                trace("this = " + this);
        }
        
}

You can also use that class as a generic class for all your timelines
and extend it like this

import mx.utils.Delegate;
import it.sephiroth.XML2Object;

class RootClass extends ApplicationClass{
        

        public function RootClass(target){
                super(target);
        }
        
        private function init(){
                trace("override init this = " + this);
        }
        
}
_______________________________________________
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

_______________________________________________
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