2016-01-19 76 views

回答

0

所以我假設你需要在同一個HTML頁面上的兩個swf之間傳遞數據。這一方法在LocalConnection

在你發送的SWF你需要的東西是這樣的:

var lc:LocalConnection; 
lc = new LocalConnection(); 

function sendMyData():void 
{ 
    lc.send("myLocalConnection", "functionToExecute", myData); 
} 

在接收器SWF:

var lc:LocalConnection; 
lc = new LocalConnection(); 
lc.connect("myLocalConnection"); 
lc.client = this; 

function functionToExecute(myData:*):void 
{ 
    trace("Received data " + myData); 
} 
相關問題