Difference between revisions of "SWFObject"

From Wikicliki
Jump to: navigation, search
Line 1: Line 1:
 
'''STATIC PUBLISHING'''
 
'''STATIC PUBLISHING'''
 +
 +
SWFObject is a better way to embed swf files in html. Its shorter than Adobe's AC_RunActiveContent, makes the flash file more compatible for other devices which use less advanced versions of javascript, and it degrades gracefully on ancient browsers.
 +
 +
Are you easily confused? Is your wmode not transparent even after checking it a hundred times over?
 +
Stop messing up the code and use the [http://www.swffix.org/swfobject/generator/ SWFobject code generator.]
  
 
1. insert the object
 
1. insert the object
Line 24: Line 29:
 
     swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
 
     swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
 
     </script></pre>
 
     </script></pre>
 
It should be strictly compliant.
 
 
[http://www.swffix.org/swfobject/generator/ Or just use the automatic code generator.]
 
  
 
*[http://www.alistapart.com/articles/flashembedcagematch/ Why it makes sense to use SWFObject]
 
*[http://www.alistapart.com/articles/flashembedcagematch/ Why it makes sense to use SWFObject]
 
*[http://code.google.com/p/swfobject/wiki/documentation SWFObject Documentation]
 
*[http://code.google.com/p/swfobject/wiki/documentation SWFObject Documentation]
 
  
 
== See Also ==
 
== See Also ==

Revision as of 11:12, 28 November 2008

STATIC PUBLISHING

SWFObject is a better way to embed swf files in html. Its shorter than Adobe's AC_RunActiveContent, makes the flash file more compatible for other devices which use less advanced versions of javascript, and it degrades gracefully on ancient browsers.

Are you easily confused? Is your wmode not transparent even after checking it a hundred times over? Stop messing up the code and use the SWFobject code generator.

1. insert the object

      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
        <param name="movie" value="myContent.swf" />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
        <!--<![endif]-->
          <p>Alternative content</p>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>

2. insert into head (the file)

<script type="text/javascript" src="swfobject.js"></script>


3. insert into head (the registration)

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

See Also