hi,
i’ve been working on a addon lately which builds flash XFL files and runs them inside openframeworks. it essentially emulates the flash player run-time using media types available in OF.
https://github.com/julapy/ofxFlash
download the source and example from git.
it came about when i was working on my last commercial project and i set myself the challenge of building the UI in OF. at first it was painful, having to set xy coordinate for every image layer and position them in the right z-order… so i started looking into alternatives and came across the new XFL flash file format, an open version of the FLA format where all assets and movieclip information is stored in XML files.
ofxFlash-screen-01 by julapy, on Flickr
WHAT IT CURRENTLY DOES
- Loads flash XFL files and builds a OpenFrameworks version.
- It emulates the Flash player run-time using the same display structure ( stage => sprite => display object container => interactive object => etc. )
- Supports 2D matrix transformations for translating, scaling, rotating and skewing display objects and applying those transformations to their children.
- Supports display lists, so display objects can be nested in other display objects.
- Uses AS3 syntax where possible to make it easier for Flash devs to understand.
- Supports rectangle and oval primitives.
- Manages media assets ( Bitmap / Video / Sound ) through the ofxFlashLibrary class.
STILL TO COME
- Mouse interaction. This will most likely be a port of ofxMSAInteractiveObject into ofxFlashInteractiveObject with a few tweaks.
- Event dispatching and management using AS3 syntax.
- Text support. Although this is a huge field, so we’ll see how far it can be pushed.
- Custom shape support. Working out XFL encoding of vector shape data and translating that into something OF friendly like a number of points.
- Support for timeline tweening. At the moment a work around this is to create a tween, copy it onto another layer and break it into key frames.
ofxFlash is still in the early stages and i would appreciate any feedback and suggestions you have.
L.