How do I embed SWF (flash) in / on a webpage?

We thought we’d give a little demo of how to embed SWF on a webpage, because it is different then embedding FLV video or HTML5 video embedding.

So what what is SWF?

From Adobe: The SWF file format delivers vector graphics, text, video, and sound over the Internet and is supported by Adobe Flash Player and Adobe AIR software. Flash Player already reaches over 98% of Internet-enabled desktops and more than 800 million handsets and mobile devices. Read more technical specs about Flash SWF file. Download the SWF file format specification (PDF, 940K)

Here’s the code for putting SWFs in a page, a SWF embedding method (copy & paste away):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<object id="FlashID" width="500" height="500" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="src" value="http://www.yourwebite/path/to/your.swf" />
<embed id="FlashID" width="500" height="500" type="application/x-shockwave-flash" src="http://www.yourwebite/path/to/your.swf" quality="high" wmode="opaque" swfversion="6.0.65.0" />
 <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>--> 
<img src="http://gravlab.com/forum/wp-includes/js/tinymce/themes/advanced/img/trans.gif" class="mceItemMedia mceItemFlash" width="500" height="500" data-mce-json="{'video':{},'params':{'quality':'high','wmode':'opaque','swfversion':'6.0.65.0',
'src':'http://www.yourwebite/path/to/your.swf'},
'name':null,
'object_html':' &lt;!--&lt;![endif]
--/&gt;&lt;
!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --&gt;&lt;div&gt;&lt;h4&gt;Content on this page requires a newer version of Adobe Flash Player.&lt;/h4&gt;&lt;p&gt;&lt;a href=&quot;http://www.adobe.com/go/getflashplayer&quot;&gt;&lt;img src=&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot; alt=&quot;Get Adobe Flash player&quot; width=&quot;112&quot; height=&quot;33&quot;
 /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt
;p&gt;&lt;!--[if !IE]&gt;--&gt;&lt;/p&gt;','hspace':null,'vspace':null,'align':null,'bgcolor':null}" alt="" /> 
<!--<![endif]--> 
</object>

Replace ‘http://www.yourwebite/path/to/your.swf’ with the link to your swf file.


Your SWF embed has worked … hopefully. Worked for us:






Since you bothered to read so far down, you get a huge bonus score: Automatic SWF Embedder / Code maker (bobbyvandersluis.com/)

Video is loading…

0