Swiffy Conversion Error (Flash to HTML5)

I converted a Flash SWF file to HTML5 using Google Swiffy.

This works fine in Firefox.

However, in IE8, I get the following errors:

'swiffy' - undefined

'stage' is null or not an object

In IE, if you go to the Google Swiffy gallery section ( http://www.google.com/doubleclick/studio/swiffy/gallery.html ) and click on any of the examples, you will get similar errors (or at least I). Perhaps this is already a problem.

I will also contact Google to find out if there is a solution to this problem.

Here is a snippet of 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 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 began to convert the Flash file, encoding it myself using Canvas. I will probably continue this. I just clicked on this time to do this, and would like these errors to be resolved.

Thanks.

Stephen

(By the way, can I attach the file? The code is really long.)

+6
source share
3 answers

This is because HTML5 Canvas is not supported in IE8

You can use the excanvas library, but this is terrible with the animation. excanvas uses VML to emulate canvas commands and pretends to work on IE7 / 8

excanvas has not been updated since 2009, and I recommend not supporting IE8 if you want to use Canvas. Perhaps the SVG / VML solution will be better, depending on what you are doing.

+3
source

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

Put this code in the header:

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

in swiffy file put this (below 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> 
+1
source

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

+1
source

Source: https://habr.com/ru/post/899290/


All Articles