我正在尝试将一个字符串从javascript发送到我的flash文件。
在.mxml
里面我有这个:
xmlLocation = (root.loaderInfo.parameters.location) ? root.loaderInfo.parameters.location : "";
它崩溃了,并给了我一个
TypeError: Error #1009: Cannot access a property or method of a null object reference.
我发送的内容不是任何内容,或者是:
function callRecorder(x){
$("#vidRecorderHolder").html("<span id='vidRecorderDIV'></span>");
currentVid = x;
var flashvars = {};
flashvars.fileName=x;
flashvars.location = "[location]";
var parameters = {};
var attributes = {};
attributes.name="vidRecorder";
attributes.id="vidRecorder";
swfobject.embedSWF("commercialtribe.swf?ID="+Math.random()*100,"vidRecorderDIV","400","400","11.2", "expressInstall.swf", flashvars, parameters, attributes);
}
我该如何解决这个问题?
答案 0 :(得分:0)
我明白了
而不是root.loaderInfo.parameters.location
它是
FlexGlobals.topLevelApplication.parameters.location