Archive for the as3 Category

Sentinel: An Autonomous NERF Gun powered by Adobe AIR and Arduino

Tuesday, September 14th, 2010

So it’s been about a year since this blog was updated, so we’re bouncing back into the blogoverse with an epic post to make up for the hiatus. The Bigger Design presents you with our Sentinel project. We strapped a NERF BFG on a homebrew swivel stand, hooked up some wires with an Arduino board, slapped a webcam on top, and brought it all together with an Adobe AIR application to make it sing.

This was part of a larger presentation given at this past spring’s Columbia Adobe User GroupRefresh Columbia double-feature meetup. Here’s another short video demonstration of the Sentinel from the meeting, courtesy of Greg Lunn.

Now we’re brushing off the cobwebs and bringing the Sentinel project back into the spotlight. Over the next few weeks, we’ll break the project down, describe its biggest challenges and how we solved them. If there’s enough interest, we’ll get your trigger finger itching with details on how you can roll your own.

Check out our Sentinel photos on Flickr.

Flash Gotcha: Giving and Getting the Finger in Flash

Thursday, September 24th, 2009

No, not like that, though I’ve seen people give Flash the finger far too many times. In our case we want the cursor to change to the finger cursor. This is the same cursor you would get when hovering over a link. By default this is turned off for MovieClips. To enable it, we add this line of Actionscript for the movieclip:

myMovieClip.buttonMode = true;

Simply take your MovieClip’s instance name and set the attribute buttonMode to true. Now when you publish your movie, rolling over the MovieClip changes your cursor.

Here’s where it gets tricky. Let’s say there’s a MovieClip in your library that needs to be used several times to contain text, such as a list of buttons. You set up the MovieClip as a class to re-use, you pull in the XML content to each class using a for loop, and then add it to the stage with buttonMode set to true. Now here comes the pain in the neck. When you hover the mouse over the MovieClip you get the cursor change, but when you move the mouse over the part of the MovieClip with the text, bye-bye cursor change.

This result is due the default behavior of text with the cursor. To disable this behavior, set the textfield inside the MovieClip to this:

myMovieClip.myTextfield.mouseEnabled = false;

Presto! Now your MovieClip behaves like a button, the cursor is not affected by the text, and you don’t have to give Flash the finger.