Embedding Flash Content in HTML


/ Published in: JavaScript
Save to your folder(s)

Javascript solution for embedding Flash in HTML


Copy this code and paste it in your HTML
  1. /**
  2.   * Embed the Proxy SWF inside the div. The Proxy SWF is key to the approach as JS does not provide
  3.   * a mechanism to communicate with 2 documents originating from different domains.
  4.   **/
  5. function embedFlash() {
  6. var url = "SWFProxy.swf";
  7. var xiSwfUrlStr = "playerProductInstall.swf";
  8. var flashvars = {};
  9. var params = {};
  10. params.allowscriptaccess = "always";
  11.  
  12. var attributes = {};
  13. attributes.id = "proxySWF";
  14. attributes.name = "proxySWF";
  15. attributes.align = "middle";
  16. swfobject.embedSWF(
  17. url, "flashContainer",
  18. "100%", "100%",
  19. "10.0.0", xiSwfUrlStr,
  20. flashvars, params, attributes);
  21.  
  22. }

URL: http://code.google.com/p/swfobject/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.