Recommended:

  • phpclasses.org
  • jsclasses.org
  • jsmag.com
  • siteapps.com
  • View our reviews on Hot Scripts
  • JS Tutorial
  • scripts.com
  • securesignup.com




Recent Comments

Powered by Disqus




Back to articles

How to embed flash objects

The best way to embed flash object is using SWFObject javascript library. It automatically checks if visitor has flash player, what version, displays corresponding message, and you don't have to worry about those things.

To use SWFObject, you need to include javascript library in your <head> tags, then create div, which will contain flash object. And after that create SWFObject, add needed and custom parameters and output object into div like that:

<head>
<script type="text/javascript" src='/js/swfobject.js'></script>
</head>
<body>
<div id="flashcontent"></div>
<script type="text/javascript">
    //"./flashcontent/flash.swf" path to your movie file 
    //"flash" this matches the “ID” from your Flash movie parameters ,
    //just put file name if you don't know anything about it
    //"800" width
    //"400" height
    //"8" Flash Player version required 
    //"F2F4FF" background color
    var so = new SWFObject("./flashcontent/flash.swf", 
                           "flash", "800", "400", "8", "F2F4FF");
    //adding custom parameters
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.write("flashcontent");
</script>
</body>

You may also be interested in:

Powered by BlogAlike.com

blog comments powered by Disqus