Capabilities of SWF loading/parsing in app targets


I’m curious is there is a list or table of the capabilities of the SWF loading/parsing library in an NME/cpp publish target (iOS/Android/Win/Mac/Blackberry). Are fonts supported for example?

A list of supported Flash APIs would be great too if such a thing exists (is Flash parody a goal of OpenFL?).

More information about SWFlite would be good too (I’ll keep looking through the documentation).


Kevin N.

When you use default “swf” parsing, most features are supported, including embedded dynamic fonts. Sound is ignored, and ActionScript bytecode is not supported, otherwise many features work. The MovieClip animation support is beta, and simple morphshape support is there, I believe.

When you use “swflite” (which is required on HTML5, and optional elsewhere), the performance can be much faster, and ultimately the runtime is much more transparent. MorphShape is not supported, multiple keyframe support has not been carried over at the moment, and embedded dynamic fonts are not supported.

However, if you embed the font in your project, SWFLite will pick the proper font. This enables it to work on native targets as well as HTML5 (the tools try to generate webfonts automatically for included fonts in your project).

It’s all open-source, and sometimes it’s just worth trying out. A surprising number of things are supported :slight_smile:

I’ll definitely try it out. A list of Flash APIs that are supported would be nice though. I’m curious about some of the more esoteric APIs, such as Flash Text Engine supported. There is one project in particular that would be useful for. It sounds like the fonts situation is pretty easy.

I’m also curious about Stage3D, and some other stuff. I see there is a project on github for stage3d. On the Flash display list side (which I assume is implemented by NME?) is there a way to use custom shaders, and otherwise mess with the rendering pipeline, etc.?

I have many questions. :smile:

Generally, we’ve tried to match the classes available under the openfl.* namespace (as well as methods available) to what features are supported. In some cases, we print a warning that some feature is not supported, where having an empty method was better for compatibility-sake than fully excluding it.

Text is so complicated, we are in the process of building a new text system in OpenFL “next” (which is what HTML5 uses as well) to better support Unicode and complex text layout, however there are not any current plans to support the Flash Text Engine API, as it might not even be possible on certain platforms.

OpenFL exposes an “OpenGLView” which allows WebGL-style access to custom hardware rendering on all targets except for Flash. The Away3D folks have been developing up a Stage3D layer that works over this, I hear it’s quite robust, and would be interested in making it a core part of OpenFL in the future.

We have two paths on the native side right now – OpenFL “next” has a Haxe-based renderer, compatible with HTML5, native, etc. This one will support custom shaders in the future. When targeting native platforms, we default to the NME/Lime “legacy” rendering solution, which is strictly native only. I do not expect to see custom shader support there, I think “next” is better suited for that

…and ask away, that’s why we have forums! :smile:

The caching issue is true for some reasons (larger files don’t stay in the cache, etc.), but for other things it might be nice to keep things in one file (fewer connections to a server can help with server load).

What happens with vector graphics? Are those converted to PNGs too, or are they stored in some other format?

Vector graphics (such as a Shape or static text) are preserved as Flash drawing instructions, and are drawn at runtime

Awesome. Where can I find more info about OpenFL Next?

When you target HTML5, it uses next, if you target Neko or C++ and use “-Dnext”, it will use it as well. Some aspects of the new GL renderer are not complete, but a lot is there.

There isn’t a formal document about it, but happy to answer questions here, and working on more documentation

Is Next the master branch over in github?

Yes, and the “legacy” version used when not next can be found in the _v2 folder