mardi 10 janvier 2017

as3-websocket-server, how to manage the results

I downloaded the library as3-websocket-server ( ) for a desktop air app and I'm trying to manage the results.

I'm using Flash professional, so I import the code by:

import com.childoftv.websockets.WebSocketServer;

Than I'm able to run the server by:

var sock:WebSocketServer = new WebSocketServer();

It works fine with an html5 client on any browser (I see it adding some trace in the .as file). But how can I manage the data I get from the browser directly in the main FLA file?

Instructions say to see but it neither works: I get error on invalid number of arguments (max1) calling the function WebSocketServerBasic.

So I'm using the main But I don't find any code to manage the results... I should need something like:

sock.onMessageReceived (do something with the message...) 

or some addEventListener...

Any suggestion?


Aucun commentaire:

Enregistrer un commentaire