送信側:
//メインタイムラインのフレームアクション
send_lc = new LocalConnection();
send_lc.onStatus = function(infoObj) {
switch (infoObj.level) {
case "status" :
result_txt.text = "通信成功";
break;
case "error" :
result_txt.text = "通信失敗";
break;
}
};
send_btn.onRelease = function() {
send_lc.send("receiver", "putMessage", "Hello");
};
受信側:
//メインタイムラインのフレームアクション
receive_lc = new LocalConnection();
receive_lc.putMessage = function(msg) {
message_txt.text = msg;
};
ok = receive_lc.connect("receiver");
if (!ok) message_txt.text = "接続できません";