Mask rendering issue after upgrading to OpenFL 9.4.0+

Hi,

I’ve recently upgraded from OpenFL 9.4.0 + patch and noticed that masks are now applied incorrectly on SWF-imported animation.

This behavior wasn’t present in 9.4.0 with the patch — it appeared only after updating.
I’ve sent a minimal reproducible example via private message.

Thanks in advance for checking this!

Are you using the ‘haxelib swf’ library?

I think, yes. This dependency is implicit.

Project of reproducible example described as:

<?xml version="1.0" encoding="utf-8"?>
<project>
	<source path="src" />
	<haxelib name="openfl" version="9.4.2" />
	<library path="assets/slots-lobby-button.swf" id="slotsLobbyButton" generate="true" preload="true"/>
</project>

Have you ever tried using code to set a mask?

Do you not use ‘starling’?

It seems that ‘haxelib swf’ is currently in the beta version

I have narrrowed it down to this commit:

I’d rather not revert, since it fixes a legitimate issue. However, I’ll need to investigate a bit more to figure out how to fix it properly.

So it looks like Flash supports something called a clipping layer, which is basically a mask, but it can apply to multiple display objects on the same timeline. Regular masks can be applied to one display object only, which is what the commit above fixed.

This issue is happening because the “swf” library sets the mask property when it applies a clipping layer. When OpenFL started enforcing the rule that a regular mask may not be shared by multiple display objects, clipping layers in the “swf” library broke.

I’m going to need to make some tweaks to both OpenFL and the “swf” library to ensure a safe API is available to apply clipping layers that works a little differently than regular masks.

This issue is now fixed on GitHub, and it will be included in next month’s OpenFL 9.5 and SWF 3.4 updates.

In the meantime, you will need the following two commits for OpenFL:

And the following commit for SWF:

2 Likes

I only use the SVG library . It seems I need to test the SVG library.

It is recommended to add APIs or parameters to the “SWF” library to customize the format of SWF export. Currently, the default format is zip, and the exported content can be a compressed file. However, I want to customize it as an. xx file because some platforms do not support uploading zip files

There is another issue that I reported last time. The SWF library can be loaded at runtime on other targets, but cannot be loaded at runtime on flash and air targets (causing errors). I hope this issue can be fixed

@785597448 When replying in someone else’s thread, please try to stay on topic. Asking about unrelated feature requests in a thread that’s about a bug report is not appropriate. Thank you!

Hi Josh,

Thank you for your quick response. I hope we see this bug fix included in the next release.