Flash in the Javascript Age

Posted by Simeon on Apr 15, 2011 in Blog, Featured | 0 comments

Flash in the Javascript Age

I was told last week that we have entered “The Age of Javascript“. The javascript age is about the migration from page based development on the LAMP stack, to the partial page loading data driven development style. A style of development that the flash community has been utilizing for at least six years. The Javascript age is not only about client side development, its about the language itself finally being recognized for the strengths it possesses. Server side Javascript has finally come of age in Node.js and is frantically being deployed by everyone out there building high capacity services for the mobile, desktop and in the browser.

If this is the beginning of the Javascript age, what are Flash platform developers to do? Well honestly I say you join them :) Our experience with the struggle of thick client development transitions into the browser very well. And Node.js is just as powerful as a backend to Flash as it is to anything else.

On monday of this week I had the opportunity present “Put some Javascript in your backend” at the 360|Flex conference in Denver. I think the session went really well and many people were excited to see the power available in Node.js. As ECMAscript brothers, Javascript and Actionscript are very similar to write. Both are event driven and writing Javascript code on the backend will be easier for most Actionscript developers than any other language.

In an HTML vs Flash world I tried to emphasize the way these tools can be used together to leverage the strengths of both platforms. Node.js is an amazing platform for real time communication and high load API’s which are required for mutli-player gaming and social mobile applications. The Socket.IO project adds to Node.js amazingly simple API for building real time applications in the browser. Utilizing WebSockets if available and failing back to several options including Flash Sockets, Socket.IO creates a simple API for applications that require real time communication.

In preparation for my presentation I wanted to demonstrate how Socket.IO could be utlized from Flash as well as from HTML. In the end I created a new project called FlashSocket.IO. FlashSocket.IO is a simple library that wraps up the web-socket.js (part of Socket.IO) library and facilitates easy communication with Socket.IO services. The FlashSocket.IO project handles the handshake and heartbeat functionality as well as serialization of object messages.

With FlashSocket.IO it is trivial to allow Flash clients to communicate with Socket.IO applications, allowing for amazing mashups between html and flash clients. As an example of this for my presentation Aaron Boushley and I created NodePoll. NodePoll is a simple application which allows users to vote on poll questions in an html client that works smoothly on all platforms. Using a Flash presenter application, you can push out new poll questions and watch a live dashboard of voting as they are sent in from clients. NodePoll provides a great example of utilizing rich Flash charting to report the results of an HTML client that can be accessed from just about any browser.

So in the age of Javascript where do flash developers fit? In the exact same place they have always. Building rich interactive application, which utilize the best parts of all available platforms.

I have not posted my slides, but I have posted all of the examples from my presentation on github. So please feel free to check out those here: https://github.com/simb/Jass

Leave a Reply