SWF loader support for assets 😄


Hey guys,

Quick update, we now have hot-reload support for SWF assets in the NPM releases, check out “features/display/UsingSWFAssets” or “demos/NyanCat” under https://github.com/openfl/openfl-samples-ts to get an example.

In short, you can import a SWF file, and processing is automatically done as a part of the build. The import returns the file path you can use to load it

import * as libraryPath from "./../assets/library.swf";


AssetLibrary.loadFromFile (libraryPath);

For anyone using Adobe Animate for Adobe Flash Professional, this provides a hot reload workflow for working with changed SWF assets, and simplifies the process of converting SWFs for use with HTML5 :thumbsup:


It’ so cool~

  1. Intellisense of openfl api can improve?
  2. How about the SWF assets become an independent tool?

I like openfl for Typescript~


There should be an openfljs command exposed by the OpenFL NPM library, so you can do openfljs process path/to/swf path/to/output.bundle in an NPM script.

The latest release added Haxe generated code output to the bundles, though the classpath won’t be added automatically in NPM releases. I think there’s more that could be done to improve this :smiley: