Skip to main content
Participating Frequently
March 8, 2018
Question

SwfObjects cannot be imported in HTML5 Canvas document.

  • March 8, 2018
  • 1 reply
  • 582 views

I have an existing project that needs to be converted to HTML.  It was written in CS5 / AS3.  When converting my flash files, I get the following warnings:

SwfObjects cannot be imported in HTML5 Canvas document and

FontEmbed cannot be imported in HTML5 Canvas document. 

The java script code calls the *.swf file using swfobject.embedSWF(swfFile, ...). 

How do I resolve this?  (I am new at this).

Thank You & Regards,

Renee

    This topic has been closed for replies.

    1 reply

    Colin Holgate
    Inspiring
    March 8, 2018

    HTML5 Canvas doesn't use the Flash Player plugin. You need to take the FLA and convert it to an HTML5 Canvas FLA, then most likely rewrite all the ActionScript as equivalent JavaScript.

    Participating Frequently
    March 8, 2018

    When I convert the flash file to HTML, this is the warning that displays after a "successful" conversion.  So, are you saying that I should ignore this warning and continue to convert my AS3 to JS?  And then when all converted, I will call the converted HTML file instead of the swfobject to load the converted HTML5 / JS?

    Thank You,

    Renee

    Colin Holgate
    Inspiring
    March 8, 2018

    Roughly speaking, yes. The AS3 code that is in the timeline will be commented out, and you could look at the old code and reuse what you can, or rewrite what can't be reused. If you did a lot of external AS3 classes you may have a lot of work to do to get that going as timeline code JavaScript. Some OOP techniques won't work out at all, and you may need to use the AS3 version as a prototype, reuse the graphics and symbols, but rewrite the code from scratch.