Propose to add one more method :)

19 views
Skip to first unread message

Димка Платон

unread,
Aug 25, 2011, 2:33:35 PM8/25/11
to jSocket
Hello,
i had a problem with encodig utf bytes using jSocket.readUTFBytes().
The error where connected with passing params using ExternalInterface.
So i added one more method to the jsocket.advanced.as and to the
jsocket.advased.js

jsocket.advanced.as:

public function readEscapedUTFBytes(length:int):String{
return escape(socket.readUTFBytes(length));
}

jsocket.advased.js:

jSocket.prototype.readEscapedUTFBytes = function(length) {
this.assertConnected();
return this.movie.readEscapedUTFBytes(length);
}

So usage in js app:

var data = unescape(Connection.socket.readEscapedUTFBytes(length));

Maybe this will be useful for passing encoded data between the swf and
js :)
Reply all
Reply to author
Forward
0 new messages