Skip to content

Instantly share code, notes, and snippets.

@jgranick
Created February 7, 2012 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgranick/1761985 to your computer and use it in GitHub Desktop.
Save jgranick/1761985 to your computer and use it in GitHub Desktop.
How to embed SWF content -- Without using <library /> (NME recipe)
package com.joshuagranick.nyancat;
import format.SWF;
import nme.display.Sprite;
import nme.Assets;
/**
* @author Joshua Granick
*/
class NyanCat extends Sprite {
public function new () {
super ();
var swf = new SWF (Assets.getBytes ("libraries/library.swf"));
var cat = swf.createMovieClip ("NyanCatAnimation");
addChild (cat);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment