Menu

Overload fails with strange errors

Help
Pondus
2006-11-21
2013-04-17
  • Pondus

    Pondus - 2006-11-21

    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;
            }
    }

     
    • bobby_peru

      bobby_peru - 2006-11-22

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.