Не знаю, где я иду не так, сейчас просто пробую это на месте. Спасибо.
sendLC.swf возвращает, LocalConnection.send () успешно
Это ошибки, которые я получаю от Flash.
Ошибка № 2044: необработанный AsyncErrorEvent :. text = Ошибка № 2095: flash.net.LocalConnection не удалось вызвать обратный вызов myMethod. error = ReferenceError: Ошибка # 1069: свойство myMethod не найдено на flash.net.LocalConnection и значение по умолчанию отсутствует.
Код для отправкиLC.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;
}
}
Код для полученияLC.swf:
import flash.net.LocalConnection
var receivingLC:LocalConnection;
receivingLC = new LocalConnection();
receivingLC.allowDomain('*');
Security.allowDomain("*");
receivingLC.connect('myConnection');
function myMethod():void {trace('Hello World')}