Posted By

vriesdewie on 02/24/11


Tagged

javascript html flash


Versions (?)

Embedding Flash Content in HTML


 / Published in: JavaScript
 

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

Javascript solution for embedding Flash in 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. }

Report this snippet  

You need to login to post a comment.