OK, I'm getting stumped while trying to use the overloading handlers.
I'm a big fan of this solution to solve the lack of overloading in
ActionScript, but it seems to be breaking my inheritance-- or-- I
don't understand how to use it well (the more likely answer). Here
goes:
I have 6 classes and 1 interface. It looks like this ( general classes
at the top [Z and A], with sub classes going down. I is the interface).
A Z
^ ^
| |
B ---- I ------ Y
^
|
C
^
|
D
Some more info to try and fix my really bad ascii uml:
A has a Y as a member field. A requires an A while constructing.
B has a C as a member field. B requires a C while constructing.
C requires a C while constructing.
D requires a Y or D while constructing.
Here's how this system is started:
var y:Y = new Y();
var d:D = new D(y);
var c:C = new C(d);
So, I'm tracing everything out. First thing called is the Z constructor.
Makes sense. Then the Y constructor is called. Both of these are fine,
because neither takes anything when constructing. However, the kicker is
when a new D is created. First thing called is the A constructor. I
assume that ActionScript starts at the top of inheritance chain and
marches down. However, what's called is the null arguments handler.
I know I'm passing it a fully functional Y. The overload handler does
not give me an error. Is there no way to accomplish this? Must I declare
every possibility of signature? Even if I explicitly set a handler for
taking an Y as an argument, it still is calling the null arguments
handler I've defined.
How can I achieve this structure in ActionScript?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it possible to send some .as file (in zip archive) rather than your ascii uml, I really don't understand it ;).....and don't see your excat problem....
thanks in addvance.
eRom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have ftp right now. Can I email your sourceforge account w/ an attachment? I've found one issue where I assumed one super() would go to the top, but it must be called at each level of the heirarchy. However, I'm still getting this trace:
No appropriate OverloadHandler found.
Overloaded Method: null
Used Arguments[1]: Y
Available Handlers:
[object SimpleOverloadHandler]
[object SimpleOverloadHandler (A) ]
[object SimpleOverloadHandler (Y) ]
[object SimpleOverloadHandler (Number) ]
Doesn't this say that I am passing in one Y? And isn't the third available handler the one that should be called?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sure you can use my sourceforge email ;)
I think I understanding your problem...but some .as files help me to be sure...
If you can attach a small file(txt or fla) for explanation of what you really want can be very useful to me ;)
Bye.
eRom.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, I'm getting stumped while trying to use the overloading handlers.
I'm a big fan of this solution to solve the lack of overloading in
ActionScript, but it seems to be breaking my inheritance-- or-- I
don't understand how to use it well (the more likely answer). Here
goes:
I have 6 classes and 1 interface. It looks like this ( general classes
at the top [Z and A], with sub classes going down. I is the interface).
A Z
^ ^
| |
B ---- I ------ Y
^
|
C
^
|
D
Some more info to try and fix my really bad ascii uml:
A has a Y as a member field. A requires an A while constructing.
B has a C as a member field. B requires a C while constructing.
C requires a C while constructing.
D requires a Y or D while constructing.
Here's how this system is started:
var y:Y = new Y();
var d:D = new D(y);
var c:C = new C(d);
So, I'm tracing everything out. First thing called is the Z constructor.
Makes sense. Then the Y constructor is called. Both of these are fine,
because neither takes anything when constructing. However, the kicker is
when a new D is created. First thing called is the A constructor. I
assume that ActionScript starts at the top of inheritance chain and
marches down. However, what's called is the null arguments handler.
I know I'm passing it a fully functional Y. The overload handler does
not give me an error. Is there no way to accomplish this? Must I declare
every possibility of signature? Even if I explicitly set a handler for
taking an Y as an argument, it still is calling the null arguments
handler I've defined.
How can I achieve this structure in ActionScript?
I lost some formatting. Let me clarify.
A <- B <- C <- D
Z <- Y
D extends C extends B extends A
Z extends Y
Both B and Y implement I
I mean Y extends Z. Sorry.
Hi,
Is it possible to send some .as file (in zip archive) rather than your ascii uml, I really don't understand it ;).....and don't see your excat problem....
thanks in addvance.
eRom
I don't have ftp right now. Can I email your sourceforge account w/ an attachment? I've found one issue where I assumed one super() would go to the top, but it must be called at each level of the heirarchy. However, I'm still getting this trace:
No appropriate OverloadHandler found.
Overloaded Method: null
Used Arguments[1]: Y
Available Handlers:
[object SimpleOverloadHandler]
[object SimpleOverloadHandler (A) ]
[object SimpleOverloadHandler (Y) ]
[object SimpleOverloadHandler (Number) ]
Doesn't this say that I am passing in one Y? And isn't the third available handler the one that should be called?
Hi,
Sure you can use my sourceforge email ;)
I think I understanding your problem...but some .as files help me to be sure...
If you can attach a small file(txt or fla) for explanation of what you really want can be very useful to me ;)
Bye.
eRom.
Hi eRom,
I just mailed you some files. Let me know if they don't get through.
Okay I reveived them today (saturday 12).
I look them on monday... ;)
Bye
eRom.