Hello!
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:");
movieLoaded(clip);
});
function movieLoaded(mc:openfl.display.MovieClip)
{
// Equivalent to calling FlxG.stage.addChild(mc);
// Neither work.
FlxG.addChildBelowMouse(mc);
mc.play();
}
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