網頁製作之flash FlashVars參數傳值

來源:互聯網
上載者:User

標籤:網頁製作   flash   原始碼   escape   

最近遇到一個問題,關於flash通過flashVars參數傳值!

貼出原始碼:

<script type="text/javascript">
imgUrl1="img/1.jpg";
imgtext1=""
imgLink1=escape("");
imgUrl2="img/2.jpg";
imgtext2=""
imgLink2=escape("");
imgUrl3="img/3.jpg";
imgtext3=""
imgLink3=escape("");



 var focus_width=1002
 var focus_height=291
 var text_height=15
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3
 
 document.write(‘<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="‘+ focus_width +‘" height="‘+ swf_height +‘">‘);
 document.write(‘<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="路徑.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">‘);
 document.write(‘<param name="menu" value="false"><param name=wmode value="opaque">‘);
 document.write(‘<param name="FlashVars" value="pics=‘+pics+‘&links=‘+links+‘&texts=‘+texts+‘&borderwidth=‘+focus_width+‘&borderheight=‘+focus_height+‘&textheight=‘+text_height+‘">‘);
 document.write(‘</object>‘);
</script>

這段代碼只能在ie下顯示正常,但是在其他瀏覽器下卻不能顯示,在網上找了好半天才找到解決方案!

解決方案:在<object></object>間,加上這句代碼

document.write(‘<embed src="路徑.swf" quality="high" width="1002" height="291" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="pics=‘+pics+‘&links=‘+links+‘&texts=‘+texts+‘&borderwidth=‘+focus_width+‘&borderheight=‘+focus_height+‘&textheight=‘+text_height+‘"/>‘);

就可以解決了!


網頁製作之flash FlashVars參數傳值

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.