socketBridge: Flash - Javascript Socket Bridge
Update: 26 Aug 2008
Have updated the SWF and Haxe sources. Due to a rookie error I had forgot to flush Flash’s output buffers when sending the message to the server. This was causing issues on some player versions.
I’ve been looking at a few flash - javascript socket server bridges recently with the hope of using one to allow me to speak to my Arduino via javascript. I’ve ended up writing my own one here - it’s usually more fun that way, and I can get it to do exactly what I need. However, there’s a couple of good options out there that you might
also want to check out:
SocketJS - Seems to work well and has a nice low file size. The only problem I had with it is that is does not easily allow for object oriented javascript as all of the callbacks are done at the global scope.
jssockets - Nice object oriented interface available here although the function called when the SWF is loaded is still in the global scope. Also this project uses Flex which makes the files size around 120+ KB, a little too large when compared with SocketJS’s ~3KB.
My version is called socketBridge, I think it does most of the things I wanted, mainly allowing for use of object oriented javascript throughout. I also avoided using Flex which kept the filesize nice and low. I’m still not 100% sure about the code quality as this is my first Flash project, prior to this I’d not written any ActionScript at all. To be honest I didn’t even write any here, it was all done using haxe.
Continue reading ‘socketBridge: Flash - Javascript Socket Bridge’ »