尝试使用面向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);
}