0
我試圖在我的HTML代碼中嵌入我的Flash遊戲。 我得到了嵌入正確的,但現在我想用GET來從URL 此獲得ID是url使用:HTML使用GET嵌入Flash SWFObject
http://localhost/directory/html/indexpage.php?id=3
我想使用嵌入代碼的URL ID:
<head>
<title> Widget </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="scripts/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.id = "3";
var params = {};
params.menu = "false";
params.scale = "noscale";
params.allowfullscreen = "false";
var attributes = {};
swfobject.embedSWF("flash/Flash.swf, "game", "398", "398", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
<link href="./mobile/styles/game.css" rel="stylesheet" type="text/css" media="screen" title="stylesheet" />
</head>
我嘗試這樣做:
swfobject.embedSWF("flash/Flash.swf?id=3", "game", "398", "398", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
我究竟做錯了什麼?
我發現,如果我取代 flashvars.id =「3」; 與 flashvars.id = getURLParameter('id'); 然後變量的設置工作。 和其他一切。 就這麼簡單,我不知道那個haha –
getURLParameter()從何而來?這是一個SWFObject方法嗎? –