0

好的,所以我正在使用 stencyl 引擎制作 Flash 游戏,我想上传一个 Swf 文件。问题是我不断收到错误

TypeError:错误 #1009:无法访问空对象引用的属性或方法。在 _247gamesonline_fla::bn0_Symbol1_2/frame1()

现在我去了 fla 文件中出现错误的那部分,并试图看看哪里出了问题,但无法弄清楚。这是代码:

stop();

var doMain:String = this.stage.loaderInfo.url;
        var doMainArray:Array = doMain.split("/");
        var domainname = doMainArray[2];
        var gamename = "nameofgame";

        var linktodjp = "http://www.247gamesonline.com/?        p=cat&order=2&tag=puzzle&utm_medium=partnergame&utm_campaign=" + gamename + "&utm_source=" + domainname + "&utm_content=partnergame";
var linktodjpfb = "http://www.facebook.com/connect/uiserver.php?app_id=201345053230176&next=http://www.3j.com/processfacebook.php%3Futm_source%3D" + domainname + "%26fgamet%3D76&display=page&cancel_url=http%3A%2F%2Fwww.3j.com%3F3Futm_source%3D" + domainname + "&locale=en_US&return_session=1&session_version=3&fbconnect=1&canvas=0&legacy_return=1&method=permissions.request&perms=publish_stream,offline_access,email,user_birthday,user_interests,read_friendlists";


buttonplay.addEventListener(MouseEvent.CLICK, playlogonow);
logo.addEventListener(MouseEvent.CLICK, gotowebsite);
logo.buttonMode = true;

stop();
function playlogonow(e:Event) {
logo.play();
gotoAndStop(2);
return;
}

function gotowebsite(e:Event) {
navigateToURL(new URLRequest(linktodjp));
return;
}

同样在代码的另一部分中,它只是说

on (release) {
_root.play();

}

帮助任何人?

4

1 回答 1

0

很难说只有那个代码。不管怎样,我建议在此处放置许多跟踪语句,以找出哪些变量实际上等于null并导致该异常。然后采取相应的行动。

于 2012-07-15T15:53:59.220 回答