Flash/as3/LocalConnection
提供: 初心者エンジニアの簡易メモ
2015年5月20日 (水) 03:17時点における127.0.0.1 (トーク)による版 (ページの作成:「 ==localconnection== *送信 import flash.net.LocalConnection; import flash.events.StatusEvent; connect:LocalConnection = new LocalConnection(); connect.send("myConn...」)
localconnection
*送信 import flash.net.LocalConnection; import flash.events.StatusEvent; connect:LocalConnection = new LocalConnection(); connect.send("myConnect", "method1", "str1"); connect.addEventListener(StatusEvent.STATUS, onStatus); private function onStatus(event:StatusEvent):void { switch (event.level) { case "status": trace("LocalConnection.send() succeeded"); break; case "error": trace("LocalConnection.send() failed"); break; } } *受信 import flash.net.LocalConnection; import flash.text.TextField; connect:LocalConnection = new LocalConnection(); connect.client = this; connect.connect("myConnect"); public function method1(str:String):void{ var txt:TextField = new TextField(); txt.text = str; addChild(txt); }