Is it possible to *create* swfs at runtime using OpenFL?

I’m looking for a way to generate & store efficiently formatted vector images for loading and display at a later time. SVG is simple enough, but not particularly efficient to store or parse. Swf seems like possibly an ideal format for this, so I was curious if there is any support in OpenFL for generating a swf from a set of shape definitions.

Thanks in advance.

I recommend checking out openfl.display.Graphics* classes, starting with Graphics.readGraphicsData() which returns a Vector of the graphics objects of the actual Sprite or Shape. Starting from there I think it’s not so difficult to write a nice lib for storing and reading GraphicsData (In the project I’m currently working on I’m storing and parsing all kinds of large unique data with the help of Haxe Serializer/Unserializer)

HaxeFoundation’s Format lib might also worth checking out, as it has a Reader and Writer for SWF format

1 Like

Thanks for the tip @igazine - this sounds really promising!