Hi All,
It is going to be easy, but I can't figure the way to implement it.
We have certain Class object referencing to some class with
constructor accepting any ... numbers of arguments. Now we are
looking for the way to invoke it dynamically, (something like
Funtion.apply does for plain methods). For example :
...
public class A {
public function A(...args) {}
}
...
var cls:Class = A;
var someArgs:Array = [1, 2, 3];
var a:* = new cls(); // <- how to pass someArgs here ?
// need the same functionality as
// var a:* = new A(1,2,3);
And the same question regarding super class dynamic constructor
invocation:
public class B extends A {
public function B() {
var myArgs:Array = [4,5,6];
super(); // <-- how to pass myArgs to parent
// class constructor, like
// super(4, 5, 6);
}
}
--
Thanks,
Vadim Melnik.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/