VerifyError: Error #1053 at run time

I finally had some time to pick up my Haxe project again, and I updated Haxe and the libraries to the latest version. However now I get this error when I run the .swf file that I built.:


An ActionScript error has occurred:
VerifyError: Error #1053: Illegal override of Component in core.containers.components.Component.

at boot_1346/init()
at flash::Boot/start()
at boot_1346()

I found this thread having the same error, but I have difficulty relating to it. Especially since it worked before I updated to the latest version.

Some background info:
The core.containers.components.Component class is a class that extends MovieClip

My current setup:
Haxe: 3.2.0
Openfl: 3.5.3
Swf: 2.1.6

Before I updated:
Haxe: 3.1.3
Openfl: 3.1.3
Swf: 1.8.9

I hope someone have an idea of what could be going wrong, and what I can try to get it working again.

Is “Component” a reserved name in Flash Player? I wasn’t aware it was, but perhaps it is? :confused:

I tried to rename the class, but it was not the issue.

However after some experimenting and testing I figured out that it was because I was overriding some functions from the MovieClip class, for example get_totalFrames and get_currentFrameLabel, after removing these overrides it is working again.

So I guess it does not allow overrides of base methods?

I think they need to match exactly. Did you use @:getter, @:setter?

No, I had actually not come across that way of writing getters and setters. And you are correct, it allows me to override the function.

This is allowed:

@:getter(currentLabel) public function get_currentLabel():String {
    return mc.currentLabel;
}

But I can’t make it work with setters, I try this:

@:setter(gotoAndPlay) public function set_gotoAndPlay(frame:Object, scene:String = null):Void {
     mc.gotoAndStop(frame, scene);
 }

But on runtime get :

An ActionScript error has occurred:
VerifyError: Error #1053: Illegal override of gotoAndPlay in core.containers.components.Component.

Would you mind trying flash.utils.Object, and not openfl.utils.Object, and see if it makes a difference?

No, I still get the same error when I try flash.utils.Object.

I recall not being able to override this function before, then they added flash.utils.Object to Haxe to try and duplicate the Object type from AS3, rather than Dynamic (which maps to * in AS3)

I’m not sure if there’s something else we can do to try and match the exact signature.

Is this one of your own classes? I can’t find any class like that in the Flash API.

Yes, it is my own class. It overrides MovieClip.

Oops, I guess I missed that in the original post.


Hold on a second…

Why are you using a setter on a function? Setters only work on variables, and only on assignment operations:

mc.gotoAndPlay = 5; //Compiler: "haha, no."

Try overriding it instead:

public override function gotoAndPlay(frame:Object, scene:String = null):Void {
    mc.gotoAndStop(frame, scene);
}

You are absolutely correct, it works when I just override it like you said. I was too focused on trying out this new way of using setters and getters that I didn’t consider if it actually is a setter or not.

@singmajesty, I tried both openfl.utils.Object and flash.utils.Object with this now correct function, and you were right in that it only works with flash.utils.Object. Using openfl.utils.Object it gives VerifyError: Error #1053 again.

Does not work in openfl 8.9.1
haxe 4.0.0
Is there any soulution in 2019 to override Movieclip methods that has Object as one of the parameter?

Im trying to override gotoAndPlay, gotoAndStop e.t.c
HTML5 target works fine, but Flash has runtime error
flash.utils.Object does not work. It seems compiles to *

Error trace:
[trace] param 1 incompatible
[trace] virt Object flash.display::MovieClip/gotoAndStop()
[trace] over * gafplayer.display::GafDisplayObject/gotoAndStop()
[Fault] exception, information=VerifyError: Error #1053: Illegal override of GafDisplayObject in gafplayer.display.GafDisplayObject.