Can I download and use SWFs at runtime?


my memory could be faulty: is it possible to download (and parse) SWF files at runtime like the other assets, avoiding to explode them at compile time?


Yes, you can load a SWF the same way you would load a Bitmap.

var loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onSwfLoad);


function onSwfLoad(e:Event):Void {

More info here: Load External Swf Library


Yes, you can currently do this, only if you openfl process your.swf first. Then you can use AssetLibrary.loadFromFile () with the path to the .bundle or you can use Loader and load the .bundle path. Something like:

openfl process your.swf swf.bundle

Generates “swf.bundle” (last argument is an optional output path)

AssetLibrary.loadFromFile ("path/to/swf.bundle").onComplete (function (library) {
    var clip = library.getMovieClip ("");
    addChild (clip);
}).onError (function (e) {
    trace (e);


var loader = new Loader ();
loader.contentLoaderInfo.addEventListener (Event.COMPLETE, function (event) {
    var clip = loader.content;
    addChild (clip);
loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, function (event) {
    trace (event.text);
loader.load (new URLRequest ("path/to/swf.bundle");