OpenFL proccess swf - specify scale?


Is it possible to specify output scale for images in swf assets?
For example I have original image in fla 500x500px, but in output I would like exported images to be 250x250px (50% scale). Idealy, that images will scale automatically also, so sprites will remain the same size.

Best regards.

Can you embed the SWF content inside a container and scale the container?

var clip = Assets.getMovieClip("mySwf:MyExportedSymbolName");
var container = new Sprite();
container.scaleX = 0.5;
container.scaleY = 0.5;

The reason is to make exported images for html5 smaller during openfl proccess task

Oh interesting!

This would certainly be possible in the tools – but is not currently supported, but happy to work with anyone interested in adding features like this

Yeah, that feature would be very useful.
Previously, I was working with AS3 Flump and created this functionality:

I can try to do my best, to implement this feature, though I am new to OpenFL source. Can you mark me place, where to look and start to dance? :slight_smile:

I’m working on a new SWF format that uses a zipped single file, uses JSON instead of Haxe serialization (in order to improve backward compatibility) and which can work on Flash as well other targets

If you want to try, use type="animate" on your library and eventually I expect this will be the default. I’ve also tried to make it simpler to understand where to work on it…

The code handling the output (requires openfl rebuild tools to recompile changes) is here:

The code handling parsing at runtime is here:

1 Like

Can you please tell, where should I use flag type="animate"? In project.xml?
I do not use swf directly. For html5 I preload bundle. Do I need to process swf with some extra parameters?

I think on dev openfl process always uses the animate format, where <library /> tags do not yet, so type is for <library path="library.swf" type="animate" /> but openfl process library.swf works too :slight_smile: