Open source tools for legacy Flash Projects with Apache Royale
The XFL Tools project is an open-source research project aimed at helping to develop tools to revive legacy Flash apps and games. It consists of:
- An implementation of the subset of the Flash AS 3 API, compatible with Royale 0.9.2+. This mainly wraps similar functionality provided by Grant Skinner's Create JS framework.
- A parser for the uncompressed XFL file format which can be exported from the Adobe Flash/Animate authoring tool.
Other projects exist such as Shumway and SpriteFlexJS - this is intended as a complimentary approach that can eventually be mixed and matched with them.
You can view a basic demo of what can be done at http://tdprogramming.com/demos/xfltools. This shows a chessboard related animation created entirely in the animated authoring environment. The symbols and tweens are parsed at run time and animated using Create JS's TweenJS package.
How to build the demo.
You will need the Moonshine IDE and Apache Royale SDK 0.9.2 or higher.
Create a new "JS Royale Browser" project in Royale and you can use a "Loader" instance to load up the saved XFL Chess demo document. Note that the XFL file itself should be inside a folder which is also named [filename].xfl. The Loader will automatically parse the various files and folders in here to spin up the symbol library etc.
Right-click the project in the explorer window at the top-left, and click "Settings" the choose "Paths".
You'll need the "as-src" folder from your checkout for a source folder, and "js-src" and "xfls" need to be added to resources so they get copied to the output folder.
Add the following to additional compiler options: -html-template=js-src/html-template.html
Create an application from the main mxml class that is created using the ApplicationFactory class. This is shown in the included project in the repo.
You need to be loading XFL files from a location that the browser accesses using a web protocol like http:// and you may need to include a .htaccess file allowing cross-origin access depending on where you're accessing it from. I'll be documenting this further soon.
If you get an issue where the compiler says that it can't find the playerglobal.swc file, you need to download it from here:
Download the version the compiler is complaining about, then rename just to "playerglobal.swc" (it'll come with the version number in the file name), then put it in the folder in your SDK directory where the compiler is looking.