Get Adobe Flash player

Archive for January, 2008

BitmapData Fun!

Tuesday, January 29th, 2008

Quick little BitmapData Experiment. I wish I had more time for this stuff.

Download and Enjoy

-Andrew

The Day My Bank Account Died

Monday, January 28th, 2008

Well, it is not quite dead yet, but it seems inevitable after I was pointed in the direction of Phidgets. Check them out! If you are like me and absolutely drool over the idea of building your own USB device and then programming it through a Flex or Flash-based application please join me in signing over my soul to this company. Not only do they offer you an assortment of sensors, solder-less connections, affordable prices and a giant amount of documentation, they have also gone and written an extremely comprehensive Actionscript 3 API for it.


While attending FlashForward 2007 this past year I was fortunate enough to sit in on Craig Swann’s presentation about userfacing (directly interactive physical interfaces). It was one of the most inspiring talks I have ever attended, so much so that I set out to create my multitouch FTIR based screen just a few weeks later. As much as I do love the things you can do with code, especially Actionscript, you can’t touch it. Phidgets abstract the complications of building userfaces and promote the creative process. Sounds like a business model I’d like to see more companies wrap themselves around.


I’ll be sure to keep updating about my mad scientist Phidget experiements. First up I think will be the proximity-based magnetic interactive screen.


-Andrew

A RangeList class in AS3 – An example of extending functionality

Thursday, January 17th, 2008

In a recent project that came across my path, I found myself needing to write a custom data structure. When I began constructing the structure in my head, I thought back to my C++ days and templated classes. Templating the functionality of a class allows you to use the class in many situations without extending the class to deal specifically with the data type you are working with (Numbers, Strings, MovieClips, etc). In AS3, there isn’t exactly a construct built in to specifically declare a class as a template. However, the perfect container is available to us to simulate this functionality; the Array.

By creating a class that acts upon objects in an Array, the data type of the objects contained in the array is irrelevant. Note that if you are planning to modify specific properties of the data type contained in the array, you will have to extend the class. This is where the templating in AS3 begins to break down, but that’s ok, there is still a lot we can do.

With the RangeList, I have created a data type similar to a circular list, however it defines a range of items that allows you to traverse a subset of the entire array and also allows you to independently modify the subset that you are currently working with. This set of functionality is great if you want to create any sort of dynamically sized menu.

And here is the source and the fla

-Andrew