[flexcoders] Multiple Inheritance

2006-10-10 Thread Daniel Freiman
I know that strictly speaking there is no way for an object to inherit from two superclasses, but doesn't anyone know a good workaround to simulate this in actionscript? Being able to write code in interfaces instead of just method definitions would be a perfect solution to this problem, but a

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Marcelo de Moraes Serpa
Use Interfaces and composition to work around the lack of multiple inheritance.On 10/10/06, Daniel Freiman [EMAIL PROTECTED] wrote: I know that strictly speaking there is no way for an object to inherit from two superclasses, but doesn't anyone know a good

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Michael Schmalle
lack of multiple inheritanceNot to start anything but, thankfully there is not multiple inheritence. Composition is an option but, from what you explain it sounds like the old, addEventListener() will do the trick. AS is event based, so that is the strong point. You can add a listener to

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Marcelo de Moraes Serpa
A PositionManager could be a solution (through the event model). However, sometimes we want more encapsulation (or black-box behaviour) and then composition is the way to go.On 10/10/06, Michael Schmalle [EMAIL PROTECTED] wrote: lack of multiple

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Daniel Freiman
in general I agree. multiple inheritance = bad. But sometimes, it's just the best way to solve one specific problem. I seem to have fallen into a trap that I've been setting for myself a lot lately which is that I've oversimplified my situation to explain the problem, and in the process created

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Darron J. Schall
Multiple inheritance is actually possible with AS3, despite popular belief that it's not supported. It's not "true" multiple inheritance int he C++ sense of the word, and you can't list more than one class as a super class via extends.. but theres a way to get the job done in AS3. I have a

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Michael Schmalle
I don't mean to ramble but, I shouldn't have even written the previous post becasue I am not looking at your problem.Peace, MikeOn 10/10/06, Michael Schmalle [EMAIL PROTECTED] wrote: Trust me, I use composition most of the time but for what you had described, events seemed like a viable

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Michael Schmalle
Trust me, I use composition most of the time but for what you had described, events seemed like a viable solution. but what happens when I want to create a component which has a registration point in the center as opposed to the top left corner? Then create an interface called like

Re: [flexcoders] Multiple Inheritance

2006-10-10 Thread Darron J. Schall
As promised, here's how to do multiple inheritance in ActionScript 3. http://www.darronschall.com/weblog/archives/000245.cfm -d Darron J. Schall wrote: Multiple inheritance is actually possible with AS3, despite popular belief that it's not supported. It's not "true" multiple