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
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
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
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
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
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
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
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
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
9 matches
Mail list logo