[haXe] Runtime exception when extending flash.event.Event

Brosbøl, Rasmus Kobberup Rasmus.Brosbol at laerdal.dk
Sun Jan 14 13:35:52 CET 2007


I'm unable to extend flash.event.Event. Or more exact, unable to override the clone() method. When trying I get the following runtime exception:

VerifyError: Error #1053: Illegal override of MyEvent in MyEvent.
    at global$init()

Here's a small example demonstrating the problem, any ideas?

---
import flash.events.Event;

class MyEvent extends Event {
    public function new(type:String) {
        super(type);
    }

    override public function clone():Event {
        return new MyEvent(type);
    }
}

class Test {
    static function main() {
    }
}
---
Compiled with:
haxe -swf-version 9 -swf test.swf -main Test

If I remove the clone method I don't get the exception.

Kind regards,
Rasmus



More information about the Haxe mailing list