Swiffy Conversion Error (Flash to HTML5)
Asked Answered
C

3

6

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.)

Calista answered 14/10, 2011 at 10:7 Comment(0)
H
3

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.

Hour answered 7/2, 2012 at 23:23 Comment(0)
J
1

This is the solution: Download the swfobject.js and keep this file in folder "scripts".

Put this code in header section:

<script type="text/javascript" src="http://www.mysite.com/scripts/swfobject.js"></script>

in swiffy file put this (bellow swiffy script):

<script type="text/javascript">swfobject.embedSWF("http://www.mysite.com/flash_files/myflash.swf", "swiffycontainer", "638", "500", "8.0.0", "myflash.swf", {}, {menu:"false", scale:"noscale", wmode:"transparent"}, {} ); </script>
Jarvey answered 5/4, 2013 at 19:25 Comment(1)
I completed this project last year and no longer have the files to work with. I would have loved to try this solution. Thanks though.Calista
M
1

The above (using swfobject.js) is a good solution! Basically use the swf in Flash supported env and HTML fallback in case of others.

Malvina answered 21/6, 2013 at 11:46 Comment(1)
you'll be able to comment on answers once you have gained enough rep :-)Wizardry

© 2022 - 2024 — McMap. All rights reserved.