Hulk Yourself

This is part of my 2010 resolution of learning something new each week. I've been playing around with using ActionScript's BitmapData and FileReference classes.

Use your webcam to position yourself in the frame. Then you can save an image to your hard drive. I still need to tweak some things, like adding controls to adjust the brightness. Press the "BEGIN" button to Hulk Yourself.



Flash Resolution-Week 3: Google Maps API + iPhone GPS Tracking

To build on my previous post about the Google Maps ActionScript API, I wanted to track the position of my iPhone in real time. I came across the site instamapper.com. After creating a free account with Instamapper and downloading their iPhone app from the Apple App Store, I was tracking my phone in no time. They have prebuilt maps that you can embed on your blog and even a Facebook application. Although I wanted to use my own map so I can have more control over the map. Instamapper has a simple little API that you can use to retrieve your information. A http call returns a string of all the data about your phone's location. Using a URLLoader to load in the request (http://www.instamapper.com/api?action=getPositions&key=584014439054448247) returns the data:

InstaMapper API v1.00
0071543339995,Demo car,1209252615,47.58822,-122.17969,25.0,27.7,349

The format of each record (seporated by commas) is as follows:

  1. Device key
  2. Device label
  3. Position timestamp in UTC (number of seconds since January 1, 1970)
  4. Latitude
  5. Longitude
  6. Altitude in meters
  7. Speed in meters / second
  8. Heading in degree

So using a split() method on the returned string, I could just parse the latitude and longitude coordinates and sent them to my Google map object. Here is a screen shot of my application. The only problem is that instamapper.com does not (yet) have a cross domain policy, which is not allowing the SWF on my server to access instamapper's server. Though it works just fine when run locally. So for now, this is just a proof of concept.



Flash Resolution-Week 2: Google Maps API

Incorporating Google Maps within Flash is one of those things that I always wanted to look into, but just never really had the time. Well it turns out that I actually did have the time, due to the fact that it only took me 10 minutes until I had a working example. I followed this tutorial from www.layersmagazine.com.

So in my example I simply mapped Mikey's house from The Goonies and inserted the Goonies logo. Yes, I am a little geeky that way. And if you don't like The Goonies please leave this site now. Just kidding.



Flash Resolution-Week 1: BitmapData & Trigonometry

A couple of areas that I'm trying to improve in are BitmapData and Trigonometry. Trig is really useful in Flash for working with angles and BitmapData can give some pretty cool effects.

I started this example by making a MovieClip rotate around a center point. I know I could have used TweenMax to rotate around a center point, but the idea here is to do the, remember? Here are some posts I referenced. Kirupa, ActionScript.org.


After I got the MovieClip rotating, I decided to use it to create some interesting effects with BitmapData. I simply referenced the ActionScript 3.0 Language Reference for this.

[Move your mouse around the stage. The closer you get to the center cross hair, the smaller the ball's radius gets. Click and drag your mouse to draw lines from the center.]



My 2010 Flash Resolution

For a while I have been wanting to focus on the areas of Flash where I am weakest. So what better way to step up my game than to make a New Year's resolution.

My resolution:
Once a week I will learn something new and post a blog entry about it here. I don't claim that I will be doing any mind-blowing or uncharted discoveries or anything, but this will be an area where I will document my process. I hope it will help others who aren't familiar with some of these concepts, but it's mostly for me to keep tabs on myself.

We'll see how I do...



Switching to a Mac, and Switching ActionScript Editors

I recently purchased a new MacBook Pro that replaces my primary Dell desktop. But now that I'm on a Mac, I am no longer able to use Flash Develop as my ActionScript editor since its developed in .NET. So I've turned to Flex Builder 3 as my ActionScript editor of choice. It is a really great editor, although it does seem a bit bulky compared to Flash Develop.

So that led me to want to learn more about the Flex Framework (MXML). Something that I've been wanting to do for some time now, but now have more of an urgent reason. So currently, I am watching the Flex 3 Essential Training at Lynda.com. (Great site!) I figured that this will give me a great overview of Flex and a tour of the Flex Builder IDE.

I realize that I can get Parallels or Fusion for the Mac so I can run Windows based applications. Perhaps I will eventually. But this way I'll be able to get more into Flex like I've been wanting to.

We'll see in a few weeks how I like the transition.



Free ActionScript 3.0 video tutorials for animators and designers

Doug Winnie, Group Product Manager for Workflow at Adobe, has a great video series on learning ActionScript 3.0. These free videos are really done well.

From Doug himself:

"Welcome to ActionScript 1:1. This integrated training resource combines video tutorials, documentation and sample files to teach you the basics of ActionScript 3.0 using Flash Professional CS4. ActionScript 1:1 is designed for Flash animators and designers that want to take their work to the next level and add custom interactivity using ActionScript 3.0, but need some guidance. In the series, I start with the very basics of accessing your objects on the stage and the library and then introduce ActionScript that will make your designs and animations interactive and dynamic."

Check them out.
http://www.adobe.dougwinnie.com/actionscript-11

These videos are also available in the iTunes Store.



Augmented Reality

The term "Augmented Reality" is something that I'm sure we'll be hearing a lot more of within the next few years. Augmented reality (AR) is a field of computer research which deals with the combination of real-world and computer-generated data (virtual reality), where computer graphics objects are blended into real footage in real time.

The first application I came across that uses this is GE. This Flash app directs you to print out a piece of paper with a pattern on it, hold it in front of your web cam, and you see a virtual world unfold where the pattern is.

Here is another example on the iPhone via the Augmented Environments Lab blog.

http://www.youtube.com/watch?v=_0bitKDKdg0

Lee Brimelow also has a great video tutorial on creating an AR Flash app with Parervision3D.

This opens up a huge possibliity for interacting with applications and games. Imagine wearing a certian pattern on your shirt while standing in front of your favorite gaming console, which has a camera pointing back at you. But instead of seeing you on the screen, you see the game's character that you are now controlling. Now, I don't know if this technology is there yet, but I can imagine that its not far off.



Awesome Tweening Class

I just have to mention how satisfied I am with the tween class that I have been using for the passed few months. For those who don't know, a tweening class is a custom set of ActionScript classes that allow you to animate any type of property in your application with pure code, no keyframes on the timeline. Jack Doyle of GreenSock has some great classes that does just that. It is the smallest filesize and most efficient tweening class I've worked with so far. Jack is constantly improving these classes. This week he just updated the sequencing capabilities with the TweenGroup class.

Below was created with a simple TweenGroup that is set to loop.

Here is a list of all the features for the classes.
http://blog.greensock.com/tweening-family-comparison



AIR/Flex Cookbook Recipes, Mmm Yumm.

Adobe is really improving their developer community. The Adobe Developer Connection is a great site for developers that has many free resources like, tutorials, demos, profiles, and sample apps. Two of the newest, and most useful for those looking to learn more about AIR and Flex are the cookbooks. There is an AIR Cookbook, and a Flex Cookbook. Within each you can find many recipes for certain functionalities and concepts.