Solved "Document is missing element map" error.

Previous implementation caused "Document is missing element map" error after switching from haxe 2 + nme to haxe 3 + openfl (as described here: http://forum.haxepunk.com/index.php?topic=339.0).