SEARCH !!

顯示具有 SWF 標籤的文章。 顯示所有文章
顯示具有 SWF 標籤的文章。 顯示所有文章

2010/02/26

如何使用swfObject

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>如何使用swfObject</title>

關於wmode

根據官方的flash文件當中指出,wmode屬性有效值有下面三種:

Window
plays the application in its own rectangular window on a web page. Window indicates that the Flash application has no interaction with HTML layers and is always the topmost item.






在html嵌入swf 時的最基本code

<object width="987" height="361">
    <param name="movie" value="swf/mainTest.swf" />
    <embed src="swf/mainTest.swf" width="987" height="361" allowScriptAccess="always" wmode="transparent"></embed>
</object>

2010/02/25

解決用swfOject 嵌入的swf 無法置中問題

something {
text-align: center;
}

swfObject wmode

解決swfObject 無法背景透明問題

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

var flashvars = {}; <--做一個空的為了下方塞參數用
var params = {};
params.wmode = "transparent";

swfobject.embedSWF("swf/mainTest.swf", "mainSWF", "987", "361", "9.0.0", "swfObject/expressInstall.swf", flashvars, params); <--參數有順序性,所以要塞flashvars

</script>

2010/02/12

SWF嵌入html時需注意

SWF嵌入html時必須要在<object/>加入 allowScriptAccess="always"

SWF才可以在網頁中順利執行