Build to html5 target with dom flag, get TypeError

Build to html5 target with dom flag, get TypeError, I am using openfl 3.06

source code:

var mask_mc = new MyRectMask();
mask_mc.size = 100;
mask_mc.x = 100;
mask_mc.y = 100;

var imgContainer:Sprite = new Sprite();
var myImageC:Bitmap = new Bitmap (Assets.getBitmapData ("img/5.jpg"));
imgContainer.addChild(mask_mc);
imgContainer.addChild(myImageC);
imgContainer.mask = mask_mc;
	
this.addChild(imgContainer);

html5 target with dom flag, test on chrome,

Uncaught TypeError: Cannot read property 'pushMask' of undefinedDisplayObjectContainer.hx:914 openfl.display.DisplayObjectContainer.$extend.__renderDOMDisplayObjectContainer.hx:922 openfl.display.DisplayObjectContainer.$extend.__renderDOMDisplayObjectContainer.hx:922 openfl.display.DisplayObjectContainer.$extend.__renderDOMDisplayObjectContainer.hx:922 openfl.display.DisplayObjectContainer.$extend.__renderDOMDOMRenderer.hx:139 openfl._internal.renderer.dom.DOMRenderer.$extend.render

Thanks!

I’ve just committed a fix that allows it to run (without masking) using the -Ddom target. We might be able to look at implementing a DOM method of masking in the future, though for now, it at least keeps things running, which is certainly ideal :smile:

The fix will go out with the next OpenFL release

Implementing a DOM method of masking is Very Very Important! :smiley: