どこが間違っているのかわかりません。今のところ、これをローカルで試してみてください。ありがとう。
sendLC.swfは戻り、LocalConnection.send()は成功しました
これは私がFlashから得るエラーです。エラー#2044:未処理のAsyncErrorEvent:。text = Error#2095:flash.net.LocalConnectionはコールバックmyMethodを呼び出すことができませんでした。error = ReferenceError:エラー#1069:プロパティmyMethodがflash.net.LocalConnectionに見つからず、デフォルト値がありません。
sendLC.swfのコード:
import flash.net.LocalConnection
var sendingLC:LocalConnection;
sendingLC = new LocalConnection();
sendingLC.allowDomain('*');
Security.allowDomain("*");
sendBtn.addEventListener(MouseEvent.CLICK, sendIt);
function sendIt(eventObj:MouseEvent):void {
sendingLC.send('myConnection', 'myMethod');
}
sendingLC.addEventListener(StatusEvent.STATUS, statusHandler);
function statusHandler (event:StatusEvent):void
{
switch (event.level)
{
case "status" :
textArea.text = ("LocalConnection.send() succeeded");
break;
case "error" :
textArea.text = ("LocalConnection.send() failed");
break;
}
}
receiveLC.swfのコード:
import flash.net.LocalConnection
var receivingLC:LocalConnection;
receivingLC = new LocalConnection();
receivingLC.allowDomain('*');
Security.allowDomain("*");
receivingLC.connect('myConnection');
function myMethod():void {trace('Hello World')}