I've converted a Flash SWF file to HTML5 using Google Swiffy.
This works fine in Firefox.
However, in IE8, I'm receiving these errors:
'swiffy' is undefined
'stage' is null or not an object
In IE, if you visit the Google Swiffy gallery section (http://www.google.com/doubleclick/studio/swiffy/gallery.html), and click on any of the examples, you'll receive similar errors (or, at least, I do). So maybe this is an existing issue.
I'll also contact Google to see if there's a solution to this issue.
Here's a snippet of the code.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Swiffy output</title>
<script src="http://www.gstatic.com/swiffy/v3.5/runtime.js"></script>
<script>swiffyobject = {"tags":
[{"id":1,"height":194,"width":609,"data":"data:image/jpeg;
base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkS
...there's a lot of converted code, most of it looks like the gibberish above...
</script>
</head>
<body style="overflow:hidden;margin:0;">
<script>var stage = new swiffy.Stage(document.body, swiffyobject);</script>
<script>stage.start();</script>
</body>
</html>
I did begin converting the Flash file by coding it myself using Canvas. I'll probably continue with it. I was just pressed for time to get this done, and would like to have these errors resolved.
Thanks.
Stephen
(BTW, can I attach a file? The code is really lengthy.)
This is because HTML5 Canvas is not supported in IE8
You could use the excanvas library but it is horrible with animation. excanvas uses VML to emulate canvas commands and pretend that it works on IE7/8
excanvas has not been updated since 2009 and I really recommend against supporting IE8 if you want to use Canvas. It's possible an SVG/VML solution would be better, depending on what you're doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With