OpenFL compile to HTML5 won't work

I am trying to port a project I made in OpenFL to HTML5, however when I try to compile it to HTML5 it won’t work. I stripped down my code to try to see where the problem was (I don’t get an error message), but even when I only do this piece of small code it won’t work.

class DemoOverview extends Sprite {
    public function new():Void {

        var temp:Sprite = new Sprite();
        this.addChild(temp);

        super();
    }
}

If I replace the code with a trace message it seems to run properly, but with this code I only see a loading bar and nothing happens. It seems like such a basic thing, and I can’t understand why it wouldn’t work.

I run it on Linux, from the command line using either “openfl test html5” or “lime test html5” neither works.
OpenFL version: 3.2.2
Lime version: 2.5.2

I hope someone can shed some light on what I am doing wrong,
Thank you in advance

On chrome and firefox you can open a developer console with F12,
does it show any errors?

Ah, good point. Yes, I do indeed get 2 errors (using Firefox):

TypeError: this.__children is undefined
TypeError: _g1 is undefined

Try with super(); at the start of the function,
addChild is probably using an array __children which wasn’t created yet.

Yes, that solved it! Thanks a lot! :slight_smile: