Created
February 25, 2011 17:36
-
-
Save mikechambers/844158 to your computer and use it in GitHub Desktop.
Showing fix for animating with no frameData
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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