HTML5 buttonMode causes errors in console

I’m using buttonMode for some MovieClip with children instances. It has labeled frames like “_up”, “_over”, “_down” in order to change button’s appearance. However, I’ve caught a bug:


Button does not have any listeners, but, when I click on it, openfl returns an error. I’m using openfl 8.9.7.

I think it’s not able to get the instance of your movieclip. The error is telling it is null. Make sure you have got the right name of the movieclip. Trace the status of movieclip.

I mean, it does not have any listeners or code. It’s just a movieclip imported from the bundle.

Ok. Does the error go away when you remove the buttonMode = true?

Yes. It can’t be error about inexistence of mc, because button particularly works, but returns an error when clicked. I’ll try clearing my exports, maybe this method will help.

oops, it did not work :frowning:

I fixed it by replacing
stage.addEventListener(MouseEvent.MOUSE_UP, __onMouseUp, true);
to
addEventListener(MouseEvent.MOUSE_UP, __onMouseUp, true);
in MovieClip.hx:1010

I just made a fix that I think should work:

Minor MovieClip buttonMode fix · openfl/openfl@0fa84ae (github.com)

This is in a working branch of mine though I would expect it to go out in the next release of OpenFL in the next weeks

Thank you :slight_smile: