Note that there are some explanatory texts on larger screens.

plurals
  1. POadobe startus text chat broken @ connection setup
    text
    copied!<p>Hello the problem i'm experiencing is when I attempt to call javascript function.</p> <p>Using Jquery @ </p> <pre><code>$("#flashtxtchat").get(0).startTxtChat() </code></pre> <blockquote> <ul> <li>ArgumentError: Error #2126: <ul> <li>NetConnection object must be</li> <li>connected. at</li> <li>flash.net::NetConnection/get nearID()</li> <li>at textchat/startChat() at</li> <li>Function/<a href="http://adobe.com/AS3/2006/builtin::apply()" rel="nofollow noreferrer">http://adobe.com/AS3/2006/builtin::apply()</a></li> <li>at</li> <li>flash.external::ExternalInterface$/_callIn()</li> <li>at ()</li> <li>List item</li> </ul></li> </ul> </blockquote> <pre><code>&lt;![CDATA[ import flash.events.*; import flash.external.*; import flash.net.*; import flash.system.*; import mx.containers.*; import mx.controls.*; import mx.core.*; import mx.events.*; import mx.styles.*; import mx.utils.*; private var netConnection:NetConnection; private var sendStream:NetStream; private var receiveStream:NetStream; private var strangerPeerID:String; public function init() : void { var url:* = FlexGlobals.topLevelApplication.url; var serverName:* = URLUtil.getServerName(url); if (!serverName.match(/(localhost|127.0.0.1)$/)) { return; } ExternalInterface.addCallback("startTxtChat", this.startChat); ExternalInterface.addCallback("gotStrangerPeerID", this.gotStrangerPeerID); ExternalInterface.addCallback("sendMsg", this.sendMsg); ExternalInterface.addCallback("stopTxtChat", this.stopChat); ExternalInterface.call("flashtxtChat_init"); return; }// end function public function startChat() : void { if (this.netConnection) { ExternalInterface.call("flashtxtChat_gotNearID", this.netConnection.nearID); } else { this.netConnection = new NetConnection(); this.netConnection.addEventListener(NetStatusEvent.NET_STATUS, this.netConnectionHandler); this.netConnection.connect("rtmfp://stratus.rtmfp.net/removed-removed/"); } return; }// end function public function gotStrangerPeerID(param1:String) : void { var _loc_3:NetStream = null; this.strangerPeerID = param1; var _loc_2:int = 0; while (_loc_2 &lt; this.sendStream.peerStreams.length) { _loc_3 = this.sendStream.peerStreams[_loc_2]; if (_loc_3.farID != this.strangerPeerID) { _loc_3.close(); } _loc_2++; } this.receiveStream = new NetStream(this.netConnection, this.strangerPeerID); this.receiveStream.play("textchat"); this.receiveStream.client = this;///temp added by me //this.strangerVideo.attachNetStream(this.receiveStream); return; }// end function public function sendMsg(msg: String) : void { sendStream.send("recvMsg", msg); } public function recvMsg(msg: String) : void { ExternalInterface.call("recvMsg", msg); } public function stopChat() : void { this.strangerPeerID = null; return; }// end function public function netConnectionHandler(event:NetStatusEvent) : void { var c:Object; var event:* = event; switch(event.info.code) { case "NetConnection.Connect.Success": { c = new Object(); c.onPeerConnect = function (param1:NetStream) : Boolean { if (strangerPeerID == null) { return true; } return param1.farID == strangerPeerID; };// end function this.sendStream = new NetStream(this.netConnection, NetStream.DIRECT_CONNECTIONS); this.sendStream.client = c; this.sendStream.publish("textchat"); ExternalInterface.call("flashtxtChat_gotNearID", this.netConnection.nearID); break; } case "NetConnection.Connect.Failed": { this.netConnection = null; ExternalInterface.call("flashCb_errorConnectingToStratus"); break; } case "NetConnection.Connect.Closed": { this.netConnection = null; this.sendStream.close(); this.sendStream = null; if (this.receiveStream) { this.receiveStream.close(); this.receiveStream = null; } break; } default: { break; } } return; }// end function ]]&gt; &lt;/mx:Script&gt; </code></pre> <p>What can be the problem? Thank you I've used a similar implementation for video chat which works flawlessly I just removed all video related functions and only left in text chat now it doesn't work?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload