我在将 flashvars 传递到我的应用程序的 swf 时遇到问题。
我正在使用 flex builder 提供的默认模板,我在其中添加了 flashvar,如 adobe livedocs 中所述:
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'langStyle=Styles_jp.swf&langId=jp_JP&langSource=jp_JP.xml'+"",
"width", "100%", ...
AC_FL_RunContent(
"src", "SOD",
"FlashVars", "langStyle=Styles_jp.swf&langId=jp_JP&langSource=jp_JP.xml",
"width", "100%", ...
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="SOD" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="SOD.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="SOD.swf" quality="high" bgcolor="#869ca7"
FlashVars="langStyle=Styles_jp.swf&langId=jp_JP&langSource=jp_JP.xml"
我需要在应用程序的预初始化状态读取 Application.application.parameters 值。似乎在这个阶段,顶级应用程序已经知道 flashvars。
使用 firebug,我在 AC_OETags.js 中放置了断点,以查看 AC_Generateobj 是否获得了正确的参数,并且它确实获得了正确的参数。输出 str 等于:
<embed src="SOD.swf" width="100%" height="100%" align="middle" id="SOD" quality="high" bgcolor="#869ca7" name="SOD" allowScriptAccess="sameDomain" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="langStyle=Styles_jp.swf&langId=jp_JP&langSource=jp_JP.xml" type="application/x-shockwave-flash" > </embed>
尽管该应用程序确实具有 flashvars;当我尝试在预初始化阶段获取它们时,我收到一条错误消息,指出 Application.application.parameters 为空。
有没有人知道我做错了什么......?
提前致谢 :)
@mgraph
这是我现在拥有的包装器:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="AC_OETags.js" language="javascript"></script>
<style>
body { margin: 0px; overflow:hidden }
</style>
</head>
<body scroll="no">
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="SOD" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="SOD.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="SOD.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="SOD" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>