1,007 views 3 comments

Javascript to AS3 – Blobby blobby

Ever since I saw Jeff Han’s lava lamp multitouch demo, I’ve been interested in ‘blobs’ or ‘meta-balls’. There’s a great new HTML5/javascript demo of interacting with blobs (moving, splitting, merging, etc) http://hakim.se/experiments/html5/blob/03/.

Please enable Javascript and Flash to view this Flash video.

The code is opensource under a MIT license so I decided to try porting the little application over to actionscript 3 to see how straight forward it is to port from javascript to as3.I know the trend is moving the opposite way – AS3 -> html5/js, but this is more a proof of concept of how easy it can be to move from one to the other. After about 2 hours messing around, I was able to port 90% (minus the window interaction and skinning). 85% of the code I didn’t have to change at all and was able to copy/paste straight from the javascript code.

Here’s the results below…

Version 2:

Please enable Javascript and Flash to view this Flash video.

Version 3:

Please enable Javascript and Flash to view this Flash video.

This could be extended by adding multitouch and making  the dragging more consistent.

Did you enjoy this post?

Comment Below , Follow Me on Twitter , Like Me on Facebook , or Network with Me on Linkedin

  • Thanh Tung

    So cool.

  • http://twitter.com/hakimel Hakim El Hattab

    I know I’m almost half a year late to reply on this but I’m happy to see that you decided to port Blob to Flash! :)

    • http://sethsandler.com/blog Seth Sandler

      Thanks Hakim, your work is an inspiration. :)