Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwfObject registerObject?

I usually used embed for flash files, but I'm interested in using SwfObject. The question is, do I have to write this on the head of my web page?

<script type="text/javascript">
swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
</script>

Or could I simply use this:

        <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
            <param name="movie" value="test.swf" />
        <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="test.swf" width="300" height="120">
            <!--<![endif]-->
            <div>
                <h1>Alternative content</h1>
                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
            </div>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>

Another question, what does the classid mean? do I have to provide this value?

Thanks

like image 424
Radicate Avatar asked Feb 13 '26 08:02

Radicate


1 Answers

swfobject.registerSWF is only required in two use cases:

  1. If you want to use Express Install
  2. If you want to require the user to have a minimum version of Flash Player before trying to view your SWF.

If neither of these cases apply to you, you can simply put the <object> element in your markup as you have written above.

If you decide to take advantage of swfobject.registerSWF, it should be placed in the <head> of your document, after importing the SWFObject JavaScript file. See the examples in the official documentation or at learnswfobject.com.

Regarding classid, it's for Internet Explorer. The outer <object> is for IE while the inner <object> is for pretty much every other browser. They require sightly different syntax. The classid value never changes. If you don't want to worry about it, use a SWFObject markup generator to generate the code for you: http://www.bobbyvandersluis.com/swfobject/generator/index.html or http://learnswfobject.com/generator/

like image 176
pipwerks Avatar answered Feb 14 '26 22:02

pipwerks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!