Archive for the Flash 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.

How to get Maya 2009 to export COLLADA for Papervision3D on a Mac.

Wednesday, March 4th, 2009

Here’s the setup: You’re looking to use Maya to export your geometry to use in your Papervision3D projects. For Mac users this is a problem since the plugin was not compiled correctly in the most recent release for Maya 2009. Maya 2008 and previous work just fine but Maya 2009 was installed using a dynamic library, so it’s fubar to the masses… until now. I figured out how to get it working after many a trial and error, but you’ll need some hard drive space and some patience to see this through. What we’re going to do is supply the missing library by installing XCode and the Boost Library to get the plug-in to work. So until the powers that be fix it, below is the workaround to get back in business.

What you’ll need:

The entire process will take less than an hour, but the user involvement is rather low.

  1. Install COLLADAMaya Plug-in
    Download the Maya plug-in disc image, mount, and install using the supplied package. Once the plug-in is installed, open Maya and navigate to Window –> Settings/Preferences –> Plug-in Manager. You will see a list of all available plug-ins. Choose “Loaded” next to COLLADAMaya.bundle.

    COLLADAMaya Plug-in Activate

    You’ll notice you receive an error, like this:

    Library not loaded: libboost_filesystem-xgcc40-mt-1_36.dylib
    Referenced from: /Users/Shared/Autodesk/maya/2009/plug-ins/COLLADAMaya.bundle
    

    This is the error we’re going to fix in the next steps.

  2. Install XCode
    Download the XCode image from Apple’s Developer site. It’s about 1GB in size. The default settings are all you need if you don’t plan on doing anything else with it. This is the biggest issue with this workaround. It will take up about 1GB of space.
  3. Install the Boost Library
    Download the Boost Library 1.36.0. Newer libraries may work, but this is the library that the plugin was compiled against in the development stage. Select the version that ends in .tar.gz. This made a difference for me, though I’m not exactly sure why. I recommend you extract the contents to the Desktop. Open Terminal, which can be found in /Applications/Utilities. To get going you need to configure the installation procedure before installing.

    In the terminal you’ll need to navigate to the Boost folder on the Desktop. Obviously if you extracted elsewhere, navigate there. Here are some Terminal commands for rookies. Once you have successfully navigated inside the Boost folder, type:

    ./configure

    This will start the configuration script. It takes a minute or two to complete. Once complete, type:

    sudo make install

    Enter your password and hit enter. Now is the time for a break, especially since it takes about 20 minutes to unpack these files. When it finally finishes you will be given a message that the library was successfully installed.

  4. Re-Enable Plug-in
    Return to Maya and re-enable the plug-in. See Step 1 to review. You should not get an error message this time around. Success!

Now you are free to model and export your your work to COLLADA for use in your Papervision3D Flash projects. Here are the settings I use to export my work:

My Export Settings

For those just getting their feet wet in Papervision3D and would like to see how their work looks in a Flash movie, try out Mr. doob’s Papervision3D Previewer.

I hope this post is helpful to those few users who were in my shoes. Leave a comment and let me know how it worked out.