How can I use the "MovieClip" animation exported from "Adobe Animate" in "Starling" when a newcomer starts using it?

How can I use the “MovieClip” animation exported from “Adobe Animate” in “Starling” when a newcomer starts using it?

May I ask how to use the “MovieClip” animation in “Starling”?

MovieClip’s in Starling are different than the standard Flash/AIR MovieClips. For the most part, you should probably treat them as two very different things, similar in name only.

I’ll assume you’re familiar with MovieClip capabilities in Flash/AIR, but in a nutshell, they are essentially capable of near anything there.

In Starling however, a MovieClip for the most part, is simply a sequence of textures. Now if you’d like to export an animation from Adobe Animate as an image sequence, this can be converted into a spritesheet / atlas, and imported into Starling very efficiently.

I personally use TexturePacker 6.0.1 (the last version to support ATF textures used by Starling).

These are direct links to TexturePacker version 6.0.1:

Just be mindful that due to licensing restriction, JXR compression is not supported under OpenFL so make sure you un-check that in TexturePacker’s ATF settings. There’s more that could be said about ATF and spritesheet settings, but at risk of already straying from your question, I’ll leave it at that.

To bring the spritesheet into Starling, something like this is a basic example:

var assetManager:AssetManager = new AssetManager();

// If you have multiple spritesheets, do this for each one.
assetManager.addTextureAtlas("some_spritesheet_name", new TextureAtlas(Texture.fromData(Assets.getBytes("pathto/spritesheet.atf")), Xml.parse(Assets.getText("pathto/spritesheet.xml"))));

// The nameofsequence is something you can reference in the generated xml files if your unsure.
// 30 here represents the framerate for this particular animation.  Adjust accordingly.
var movieClip:MovieClip = new MovieClip(assetManager.getTextures("nameofsequence"), 30);
addChild(movieClip);

// For the animation to tick (play), it must be added to the Juggler.
Starling.current.juggler.add(movieClip);
2 Likes

My animation is very long, exported 12 texture images? Can Starling be used? Note that it’s not a single sheet, it’s multiple sheets

Whether it’s too much or not really depends on the target platform. These textures are loaded into GPU memory, so there’ll need to be enough of that.

For a project I’m currently developing, I’m testing with 56 x 4096x4096 ATF spritesheets. That’s consuming just under 1GB of VRAM. This application will be running on a display server with 8GB of VRAM, so in my case, 56 textures is just fine.

1 Like