Skip navigation
SlickRik
Currently Being Moderated

socket.io help please

Apr 9, 2012 9:52 AM

Tags: #as3 #json #socket.io

I've been asked to build a flash/AS3 app which displays JSON formatted data from a web socket

 

I've been told the HTML5 version (that i don't have access to) does the following:

 

uses a web socket and JSON formatted messages obtained by opening a socket back to the server and setting up a handler for receiving dynamics messages

 

in the HTML5 version the following code happens:

// Make a socket connection and wait to receive data

webSocket = io.connect(webSocketHost + ":" + webSocketPort);

webSocket.on('dynamics', onDynamics);

 

// Subscribe to data

webSocket.emit('subscribe', intersectionName);

 

This is outside of my comfort zone, but there's no-one else to action this.

 

I've read up on socket connections and IO, Blaze etc etc but everything seems to utilise a huge amount of code but the HTML5 version only has the 3 lines above.

 

Could someone point me towards an example or talk me through the AS3 (preferably not Flex) equivalent please?

 

thanks for anything, Rich

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points