我正在尝试将 game.swf 加载到 main.swf 中,当 game.swf 中的游戏完成时,它将通过玩游戏获得的分数和星星发送到 main.swf ,但问题是 main.swf 是没有收到值并给出上述错误。请帮忙..
main.swf 中接收分数和星星的代码是,
var receiving_lc:LocalConnection;
receiving_lc = new LocalConnection();
receiving_lc.connect("gameToEngine");
receiving_lc.client = this;
public function saveScore(score:int, stars:int):void
{
trace("score="+score.toString()+ " stars="+ stars.toString());
}
game.swf 中发送分数和星星的代码是,
var sending_lc:LocalConnection;
sending_lc = new LocalConnection();
function send_it(evt:MouseEvent):void
{
sending_lc.send("gameToEngine", "saveScore", score, 2);
}
my_btn.addEventListener(MouseEvent.MOUSE_UP, send_it);
请帮助解决这个问题......
解决了....
在 fsbmain 的帮助下...
只需要将接收_lc 设为全局变量...希望对您有所帮助..