尝试访问flashvar时出现错误1009

时间:2013-07-22 15:30:29

标签: javascript flash flash-builder

我正在尝试将一个字符串从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);   
    }

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我明白了

而不是 root.loaderInfo.parameters.location 它是

FlexGlobals.topLevelApplication.parameters.location