SWF8 需要時或被載入後再由 JS 取出
SWF9: AS3
private var paramObj:Object;
private function init():void{
paramObj = Application.application.parameters;
ExternalInterface.call('setMyVars', paramObj);
}
JavaScript:
var myVars;
function setMyVars(v){
myVars = v;
/*
var s='';
for(var i in v){
s+= i+' : '+v[i]+'\n';
}
alert(s);
*/
}
function getMyVars(){
return myVars;
}
SWF8: AS2
import flash.external.ExternalInterface;
var myVars = ExternalInterface.call('getMyVars');
JavaScript 的 alert() 有時也是個很好的除錯工具
沒有留言:
張貼留言