尝试使用以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);

}

最佳答案

尝试使用allowInsecureDomain代替allowDomain

10-07 12:53