@singmajesty I found bug in OpenFL 6.1.0, when loading asset from swf and trying to get mask object I am getting error. target: HTML5
Stage.hx:1207 Uncaught TypeError: Cannot set property 'height' of null
at DocumentClass.Main [as __class__] (Main.hx:24)
at DocumentClass [as __class__] (ApplicationMain.hx:290)
at Function.ApplicationMain.start (ApplicationMain.hx:194)
at Array.tmp (ApplicationMain.hx:95)
at lime_app__$Event_$Void_$Void.dispatch (EventMacro.hx:101)
at openfl_display_Preloader.start (Preloader.hx:250)
at openfl_display_Preloader.display_onUnload (Preloader.hx:114)
at openfl_events__$EventDispatcher_Listener.f [as callback] (TouchData.hx:33)
at openfl_display_DefaultPreloader.__dispatchEvent (EventDispatcher.hx:217)
at openfl_display_DefaultPreloader.__dispatchEvent (DisplayObject.hx:414)
this is code and sample swf file
package;
import openfl.display.Sprite;
import openfl.Assets;
class Main extends Sprite {
public function new () {
super ();
var mov = Assets.getMovieClip ("library:MaskedMv");
addChild(mov);
var getMask = cast mov.getChildByName('masked');
getMask.height = 10;
}
}
This might not be the problem in this case, but this still bugs me. You’re using cast without telling Haxe what to cast it to. This can make the compiler fail to notice errors, and Haxe will use reflection to access the properties, which is slightly slower.
I got reports that our previous MovieClip logic resulted in rendering issues, and received a large pull request with a rewrite which was said to improve performance and accuracy. The rewrite lost this feature with masks, and I am hesitant to add it in quickly, for fear of reverting some case where masks where rendering when they shouldn’t have. Ultimately, it comes down to needing to track the display list hierarchy for the animation separately from the actual display list – which enables the addition of masks or custom objects without disrupting the animation.
@singmajesty for this bug I can’t port project to OpenFL 6 (((((( for me this is very critical issue
lot of project have to move from flash to OpenFL/HTML5