AfterEffects exported SWF does not show up on CPP


I’m trying to embed an animation on the cpp target. For that I exported a swf from AfterEffects, and have referenced it in my Project.xml:

<haxelib name="swf" />
<library path="assets/cutscenes/HeavyMetalTrailer.swf" preload="true" />

Then, from a Flixel state (although flixel is not relevant here – I’m operating directly on stage ), I preload the swf, and add the timeline to the stage:

Assets.loadLibrary("HeavyMetalTrailer", function (_) {
    var clip = openfl.Assets.getMovieClip("HeavyMetalTrailer:");

function movieLoaded(mc:openfl.display.MovieClip)
    // Equivalent to calling FlxG.stage.addChild(mc);
    // Neither work.

A trace of mc.currentFrame shows it’s playing on loop (1-309 frames), but tracing width or height returns 0.

Setting the swf to type="swflite" on the Project.xml throws a compile-time error:

Error: Invalid field access : width
Build halted with errors.

I’m not sure what else to do? Has anyone successfully embeded a timeline animation in Openfl?

(I can also provide the swf for testing, if necessary)

Openfl: 3.6.1 (Likely on Legacy mode, from flixel)

swf: 2.2.0

Could you try openfl create sample NyanCat AfterEffectsTest

Open the project and replace the Nyan Cat SWF with your SWF, and see if it works (without legacy). It would be helpful to test it in isolation to see how it works, and if it does not work right, then you could share that here (or privately to me if you want) and we could take a closer look :slight_smile:


Thanks for the help!

Using the NyanCat demo with my swf throws

Error: Invalid field access : width
Build halted with errors.

as well, with or without -Dnext!

Link to swf.