0
我想通常使用ExternalInterface並訪問main.swf中的.as文件(connect.as)的公共函數。我可以使SWF零個錯誤,但我沒有看到日誌和功能...如何訪問.as文件中的公共功能
例如有一個名爲創建
public function create(webSocketId:int,url:String,protocols:Array,proxyHost:String=null,proxyPort:int= 0,headers:String=null):void {
我嘗試甚至connect.as中調用它的功能
create(0,'ws://mysie.com:8004',undefined,undefined,undefined);
PS:我已經檢查上面的代碼通常是什麼在通過
的main.swf < <我已經給該文檔的CLA connect.as的SS
connect.as:
package net.gimite.websocket {
import flash.display.Sprite;
import flash.external.ExternalInterface;
import flash.system.Security;
import flash.utils.setTimeout;
import mx.utils.URLUtil;
ExternalInterface.call('consol.log',"flash hello");//<----not working
public class WebSocketMain extends Sprite implements IWebSocketLogger{
//there are lots of public functions I'm trying to access from main.swf in here
的main.swf不喜歡線上的兩個在此嘗試:
import connect;
var connect:Connect = new Connect();
connect.create(10,'ws://mysite.com:8004',undefined,undefined,undefined);
場景1,層 '1層',幀1,第2行1026:構造函數必須是實例方法。
哦對!我以爲當我開始這個類似的JavaScript ...非常痛苦,幾乎是蘋果 –
,這是行不通的。如果你必須已經在一個函數中,那麼你如何啓動一個函數? –