IE8, Firefox3で動作確認済
ポイントは2つ。
ActionScript側: 「Application.application.parameters.パラメータ名」でパラメータを取得。
html側: flashVarsに渡したいパラメータを定義。index.template.htmlを編集するのが無難。
ActionScript側のコード例
html側から渡されたmidパラメータを表示する。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
width="400" height="400"
creationComplete="initParameter()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function initParameter():void
{
Alert.show(Application.application.parameters.mid);
}
]]>
</mx:Script>
</mx:Application>
index.template.html側のコード例
AC_FL_RunContent()内にFlashVarsの定義を追加。midパラメータを定義
if (hasProductInstall && !hasRequestVersion) {
/* 省略 */
} else if (hasRequestVersion) {
AC_FL_RunContent(
/* 省略 */
"FlashVars", "mid=99" // AC_FL_RunContent内の末端に追加
);
} else {
/* 省略 */
}
ヘルプを参照して以下のようなやり方を試したが上手く動作しなかった。謎。
<object>
<embed>
<param name='flashVars' value='mid=99'/>
</embed>
</object>
2011-02-13
最終更新:2011年02月13日 17:05