尝试使用针对 Flash Player 11.1 的 Flash Professional CC 建立本地连接 此代码在测试和浏览器中有效,在调试期间没有错误,在我的没有域的服务器上工作正常,但在我的使用 SSL 的服务器上无效。知道可能出了什么问题吗?
发送 SWF
import flash.net.LocalConnection;
import flash.system.Security;
Security.allowDomain("*");
var conn:LocalConnection = new LocalConnection();
conn.allowDomain("*");
var analstring:String = new String();
function fun():void{
conn.send('analconnect', 'analHere', analstring);
}
var button:myBut = new myBut();
button.addEventListener(MouseEvent.CLICK,gogo);
function gogo(event:MouseEvent):void{
loaderSprite.scaleX = loaderSprite.scaleX * 1.5;
analstring = loaderSprite.width.toString();
fun();
}
接收 SWF
import flash.system.Security;
import flash.net.LocalConnection;
Security.allowDomain("*");
var conn:LocalConnection = new LocalConnection();
conn.allowDomain("*");
conn.client = this;
for (var ccc:int = 0;ccc<3;ccc++){
try{conn.connect('analconnect')}catch(error:Error){gotoclose()};
}
function gotoclose():void{
try{conn.close()}catch(error:Error){};
}
function analHere(newText:String):void{
tesa2.text = newText;
tesa2.setTextFormat(tesaform2);
addChild(tesa2);
}