2007年10月12日 星期五

修正使用Internet Explorer 瀏覽器時, Flash會出現外框

第一,
請下載Javascript修正程式(flash-fix.js)
http://www.TexasWebDevelopers.com/downloads/flash-fix.zip

第二,
在您的網頁之中, 請插入下面這行
<script type="text/javascript" src="flash-fix.js"></script>

第三,
修改Flash的使用物件,
例如您原本的Flash使用語法如下
=============================================
<object classid=" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="500" height="100" id="mymovie">
<param name="movie" value="movie.swf?variable=varvalue">
<param name="flashvars" value="variable=varvalue"> << Your code may not have variables.
<param name="quality" value="high">
<param name="bgcolor" value="#003399">
<embed ></embed>
</object>

=============================================

<object...> ..... </object> 的標籤全刪除,

加入下面的語法
=============================================
<div id="flashcontent"></div>
<script type="text/javascript">
var fo = new FlashObject("movie.swf", "mymovie", "500", "100", "6,0,0,0", "#003399");
fo.write("flashcontent");
fo.addVariable("variable", "varvalue");
</script>

=============================================

而用法說明如下
=============================================
<script type="text/javascript">
var fo = new FlashObject("flash檔名","flash的id","flash寬","flash高","flash版本","flash背景色");
fo.write("div的ID值");
fo.addVariable("其他參數1", "其他參數值1");
</script>