• View our reviews on Hot Scripts
  • JS Tutorial

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:

<script type="text/javascript" src='/js/swfobject.js'></script>
<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");

You may also be interested in:

Powered by

blog comments powered by Disqus