I test some cases with Overloading concept....
Very cool tool !
Is there any possibility to build an OverloadHanlder for :
- Null or undefined arguments
- one or multi arguments.....
Exemple, if I have a small test class like that :
class TryOverload
{
function TryOverload() {
var overload:Overload = new Overload(this);
overload.addHandler([Number], setNumber);
overload.addHandler([String], setString);
overload.forward(arguments);
}
}
In myfla I try a
var test = new TryOverload(10,10,10,20,30);
or
var test = new TryOverload(10,10);
or
var test = new TryOverload();
How can I build OverloadHandler ?
Thanks ;)
eRom.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay you already got it. ;)
You must create a new class that extends the OverloadHandler class and add this class via the appropriate method to an instance of class Overload.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay...the solution is to Test for arguments length between overloading so....
However it should be cool for constructing, for exemple, an Array with Array instance or list of elements....
But indeed it is a very specific situation ;)
Thanks.
eRom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I test some cases with Overloading concept....
Very cool tool !
Is there any possibility to build an OverloadHanlder for :
- Null or undefined arguments
- one or multi arguments.....
Exemple, if I have a small test class like that :
class TryOverload
{
function TryOverload() {
var overload:Overload = new Overload(this);
overload.addHandler([Number], setNumber);
overload.addHandler([String], setString);
overload.forward(arguments);
}
}
In myfla I try a
var test = new TryOverload(10,10,10,20,30);
or
var test = new TryOverload(10,10);
or
var test = new TryOverload();
How can I build OverloadHandler ?
Thanks ;)
eRom.
Okay I've got the solution in RFE
Thanks.
Okay you already got it. ;)
You must create a new class that extends the OverloadHandler class and add this class via the appropriate method to an instance of class Overload.
The Overload Handler from the CVS supports null and undefined arguments.
Multiple Arguments probably won't be supported.
"Multiple Arguments probably won't be supported."
Okay...the solution is to Test for arguments length between overloading so....
However it should be cool for constructing, for exemple, an Array with Array instance or list of elements....
But indeed it is a very specific situation ;)
Thanks.
eRom
Okay. I'll add it to my todo list. ;)
I'll implement it the way Java does.
Cheers
Simon