No matter how I try to slice and dice my code to make overloading work, I always get the following errors every time I even as much as instantiate Overload.as:
**Error** C:\code\actionscript\org\as2lib\env\except\StackTraceElementStringifier.as: There is no property with the name 'e'.
**Error** C:\code\actionscript\org\as2lib\env\except\StackTraceElementStringifier.as: Line 101: There is no method with the name 'e'.
result = "Exception was thrown during generation of string representation of stack trace element: \n" + StringUtil.addSpaceIndent(e.toString(), 2);
**Error** C:\code\actionscript\org\as2lib\env\reflect\ReflectUtil.as: There is no property with the name 'e'.
Total ActionScript Errors: 3 Reported Errors: 3
My code does this:
import org.as2lib.env.overload.*;
import org.as2lib.core.BasicClass;
import org.as2lib.env.except.IllegalArgumentException;
class MyClass {
public function myMethod() {
var o:Overload = new Overload(this);
o.addHandler([Number,String], myMethodByNumberAndString);
o.addHandler([Number], myMethodByNumber);
o.addHandler([String], myMethodByString);
return o.forward(arguments);
}
public function myMethodByNumberAndString(number:Number, string:String):Void {
trace("myMethod(Number, String):Void");
}
public function myMethodByNumber(number:Number):Void {
trace("myMethod(Number):Void");
}
public function myMethodByString(string:String):Number {
trace("myMethod(String):Number");
return 1;
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There doesn't seem to be anything wrong with the way you're implementing Overload - I could compile your test class in Flash Pro 8 without errors. The error seems to be when compiling try/catch statements. Not a great help I know but...I guess make sure you're using AS2LIB version 0.93 and check your Flash publish settings and class paths(?). Or try instantiating org.as2lib.env.except.IllegalArgumentException to see if that's where the errors are coming from.
Bobby
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi There,
No matter how I try to slice and dice my code to make overloading work, I always get the following errors every time I even as much as instantiate Overload.as:
**Error** C:\code\actionscript\org\as2lib\env\except\StackTraceElementStringifier.as: There is no property with the name 'e'.
**Error** C:\code\actionscript\org\as2lib\env\except\StackTraceElementStringifier.as: Line 101: There is no method with the name 'e'.
result = "Exception was thrown during generation of string representation of stack trace element: \n" + StringUtil.addSpaceIndent(e.toString(), 2);
**Error** C:\code\actionscript\org\as2lib\env\reflect\ReflectUtil.as: There is no property with the name 'e'.
Total ActionScript Errors: 3 Reported Errors: 3
My code does this:
import org.as2lib.env.overload.*;
import org.as2lib.core.BasicClass;
import org.as2lib.env.except.IllegalArgumentException;
class MyClass {
public function myMethod() {
var o:Overload = new Overload(this);
o.addHandler([Number,String], myMethodByNumberAndString);
o.addHandler([Number], myMethodByNumber);
o.addHandler([String], myMethodByString);
return o.forward(arguments);
}
public function myMethodByNumberAndString(number:Number, string:String):Void {
trace("myMethod(Number, String):Void");
}
public function myMethodByNumber(number:Number):Void {
trace("myMethod(Number):Void");
}
public function myMethodByString(string:String):Number {
trace("myMethod(String):Number");
return 1;
}
}
There doesn't seem to be anything wrong with the way you're implementing Overload - I could compile your test class in Flash Pro 8 without errors. The error seems to be when compiling try/catch statements. Not a great help I know but...I guess make sure you're using AS2LIB version 0.93 and check your Flash publish settings and class paths(?). Or try instantiating org.as2lib.env.except.IllegalArgumentException to see if that's where the errors are coming from.
Bobby