Skip to content

Instantly share code, notes, and snippets.

@mikechambers
Created February 25, 2011 17:36
Show Gist options
  • Save mikechambers/844158 to your computer and use it in GitHub Desktop.
Save mikechambers/844158 to your computer and use it in GitHub Desktop.
Showing fix for animating with no frameData
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Flash to Canvas Animation Example</title>
<script src="easel.js"></script>
<script>
var stage;
var bmpSeq;
function init()
{
stage = new Stage(document.getElementById("mainCanvas"));
var img = new Image();
img.src = "sausages.png";
var spriteSheet = new SpriteSheet(img,251,181);
bmpSeq = new BitmapSequence(spriteSheet);
stage.addChild(bmpSeq);
bmpSeq.gotoAndPlay(0);
Ticker.addListener(window);
}
window.onload = init;
function tick()
{
stage.update();
}
</script>
</head>
<body>
<canvas id="mainCanvas" width="500" height="300"></canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment