2010年5月4日 星期二

FlashVars, HTML參數,給予SWF使用

AC_FL_RunContent(  "src", "playerProductInstall",
 "FlashVars",        "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "${width}",
"height", "${height}",
"align", "middle",
"id", "main",
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", http://www.adobe.com/go/getflashplayer,
"flashVars" , "embedCode=test1234567"
);

} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
 "src", "${swf}",
 "width", "${width}",
 "height", "${height}",
 "align", "middle",
 "id", "main",
 "quality", "high",
 "bgcolor", "${bgcolor}",
 "name", "${application}",
 "allowScriptAccess","sameDomain",
 "type", "application/x-shockwave-flash",
 "pluginspage", http://www.adobe.com/go/getflashplayer,
 "flashVars" , "embedCode=test1234567"
);
 
<noscript>
 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  id="main" width="${width}" height="${height}"
  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
 <param name="movie" value="${swf}.swf" />
 <param name="quality" value="high" />
 <param name="bgcolor" value="${bgcolor}" />
 <param name="allowScriptAccess" value="sameDomain" />
 <param name="flashVars" value="embedCode=test1234567" />
 <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
   width="${width}" height="${height}" name="${application}" align="middle"
   play="true"
   loop="false"
   quality="high"
   allowScriptAccess="sameDomain"
   type="application/x-shockwave-flash"
   pluginspage=http://www.adobe.com/go/getflashplayer >
   flashVars="embedCode=test1234567">
 </embed>
 </object>
</noscript>
 
 
§於Swf中的程式取得HTML頁面上的變數
var embedCode:Object = root.loaderInfo.parameters["embedCode"];

沒有留言:

張貼留言