Well yeah, I don't actually instantiate it like that (as it will always run before the constructor), I was just showing an example. I have the whole lot in a .inc file and include it:
http://pastie.textmate.org/340790 -Josh On Wed, Dec 17, 2008 at 12:17 AM, Amy <[email protected]> wrote: > --- In [email protected], "Josh McDonald" <dzn...@...> wrote: > > > > Don't call "new EventDispatcher()", it won't be any real use. The main > > reason you would want to create an instance of EventDispatcher itself > is > > when you're building a class that is an IEventDispatcher, but > inherits from > > a base class that is not an IEventDispatcher, because we don't have > multiple > > inheritance in AS3. When you do that, you need to use something like: > > > > private var myEventDispatcher : IEventDispatcher = new > > EventDispatcher(this); > > My experience with this is that occasionally that will run before the > constructor and you'll get an error--it seems to be safer to put the > assignment statement inside the constructor, even though it makes it a > PIA to have boilerplate IEventDispatcher code that you copy in when you > want to add event dispatching. > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [email protected] :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk

