|
Step Three: Embed SWF file into HTML

It is easy to embed SWF into html. You just need to insert following code into HTML file:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="766" height="760" id="show" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="show.swf" />
<param name="quality" value="high" />
<param name="allowFullScreen " value="true" />
<embed src="show.swf" quality="high" width="766" height="760" name="show" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Please make sure that html file and show.swf file are in the same directory, if not please modify the value of the node <param name="movie" value="show.swf" /> and modify src in embed node.
AllowFullScreen attribute offers the optional for full screen in the browser whose FlashPlayer version is above 9. By setting the parameters as 'true', the Flash window can be full screened.
Notice: you can set the width value and height value in the object node and embed node respectively to decide the size of show. For some of the browser which is not standard, Flash may not get the correct value of width and height; you can add FlashVars parameters to solve this problem:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="766" height="760" id="chat" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="show.swf" />
<param name="quality" value="high" />
<param name="FlashVars" value="width=766&height=760" />
<param name="allowFullScreen " value="true" />
<embed src="main.swf" quality="high" width="766" height="760" name="show" align="middle" FlashVars="width=766&height=760" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
What's more, for the problem that the Flash ActiveX control needs to be activated by mouse clicking in IE, you can solve this problem by JavaScript. There are two methods at present: one is acivecontent_samples offered by Adobe, the other is swfobject script offered by the third party. |