No Flash on Tap for us.

Flash on Tap is coming up real soon (May 28th-30th). The speaker list looks amazing. But what matters more to me is the beer. Sadly neither Matt or I will be attending Flash on Tap, but if I was, I would be hitting up The Bruery, Stone and Lagunitas. Unfortunately, the cost of these conferences are pretty high for out-of-pocket, and it can be quite a hassle to try to get a company to pay for you. Either way... This looks to be a terrific Flash conference, and you can't go wrong with adding beer into the picture. Although watch out, Todd is an angry drunk.

That being said, Matt and I will be volunteering at the American Craft Beer Fest (June 19th/20th). This is one of (if not the) largest beer fests on the East Coast and shouldn't be missed. There's also a good chance I'll be attending the Great American Beer Fest.

From Flash to Android? Sure, why not!

No, I don't have an iPhone. Thats right! No iPhone here. Why you say? Well, I dunno...it just never was all that exciting to me. I'm always skeptical of hyped up products, not to mention Apple's first, and even sometimes second, generation of a product tends to have its fair share of problems. So once I heard about Android and the "Google Phone" I decided I wanted to be a rebel and go the way of the nerd. I've had the phone for about four or five months now and I have to say I'm an extremely happy G1 owner. Sure its not the most "jazzy" OS for a phone, but I'm not the type of person that needs to be wowed by the user experience, especially when I look at my phone as simply a tool for accomplishing simple tasks, not being constantly entertained. At any rate, now happy and comfortable using the platform, I've decided to start teaching myself how to make applications for it.

I haven't got too far in depth with the SDK yet, but I'm rather pleased to see some vague similarities between an Android project and a Flex project. The first, and most obvious, similarity is the XML based view definitions and other external resources. Second, I've never written Java before but I'm picking it up very quickly. A few friends have already told me that ActionScript 3 and Java are very similar, but I had no idea it would be this easy. The most difficult thing for me at this time is just trying to remember all the considerations you have to make when writing an application for a mobile platform. The book I've got my hands on, Professional Android Application Development, has done a great job of outlining what to think about when writing an Android app, but I highly doubt I'll remember it all come time to write my own app. Alas, thats all part of getting into a new platform.

In the future I hope to write a bit about my experience learning the platform and perhaps provide some unique advice for any other Flash developers looking to get into it. Who knows, maybe I'll have an application available on the market some day!

Oh, and Marc will hopefully be getting into iPhone development soon too.

Great BitmapData Usage Example: messmaker.com

Image

Here's a great example of a site that allows the user to create a custom composition by using a butt load of animated bitmap assets. I'm quite impressed, one of the most solid executions of this technique I've seen in a while. Not to mention Harry is a great little character to have as a host.

SXSW Interactive 2009

So I failed to mention that I would be heading down to Austin, Texas for SXSW Interactive. Overall, it was a great experience. My only complaint is how exhausting it was. Getting up at 9AM to go to sessions and panels, then party into the wee hours of the night can really take its toll on the old legs and liver. Regardless of how I feel now I would certainly recommend anyone in the internet industry to attend this event. Attending the sessions and panels is a great way to stay abreast to trends and whats new or popular in the business. And if you care, the parties are a great way to do some networking or just meet some new people and share ideas.

Read the rest of this entry »

AS3: Stopping All Timeline Animations

I haven't posted in months for good reason. I've been involved in a pretty large project at Almighty that led to many late nights. All in all though, the end product turned out to be pretty awesome. I'll post something more on it later. Until then, I hope to roll out some snippets of code that I found useful during the project.

The following snippet of code is a recursive loop that halts all timeline-based animations (assuming they're on a gotoAndStop() loop. This came in handy when working with animation designers.

function haltAllAnimations( mc:MovieClip = null ):void
{
    if( !mc ) mc = this as MovieClip;
 
    for(var i:int = 0; i < mc.numChildren ; i++)
    {
         if( (mc.getChildAt( i ) is MovieClip) == false ) continue;
 
        MovieClip( mc.getChildAt( i ) ).stop();
        if( mc.numChildren > 0 )
            haltAllAnimations( MovieClip( mc.getChildAt( i ) ) );
    }
}

Type Coercion Failed of the Same Class?

So I have this issue that I just can't seem to figure out. The Flash Player keeps throwing a Type Coercion Failed error at runtime. Usually when this error pops up I have no problem figuring it out because its usually two different object types. However, in this case, this time its of the same type. It reads:

TypeError: Error #1034: Type Coercion failed: cannot convert super.secret.package::BeverageAsset@2f2b96a1 to super.secret.package.BeverageAsset.

Odd, right? Ok, so now let me explain the structure a bit. At the top level is app.swf. This SWF does not include the BeverageAsset class compiled into it. This SWF manages the loading and unloading of other SWF files that represent sections. One of these sections is recipes.swf. This SWF is loaded into app.swf and is the first SWF to have BeverageAsset compiled into it. This SWF also loads various SWF display assets in order to function properly. One of these SWF's is beverage01.swf. These assets are of type BeverageAsset. This class is used as the document class for each display asset which also has two movie clips on the stage.

So, when I compile recipes.swf and it runs standalone there is no type coercion failure. I only get the error when recipes.swf is loaded and run within app.swf. Now in my experience, I thought all child SWF's loaded into an app, unless explicitly told not to, would use app.swf's application domain unless a class does not exist yet. So once recipes.swf is loaded into app.swf, since BeverageAsset is compiled into recipes.swf, it would be added to the application domain. Thus, once beverage01.swf is loaded into recipes.swf the BeverageAsset class will already be in the application domain and that one will be used.

I mean, am I totally wrong? I'm totally baffled. Any help would be greatly appreciated.

UPDATE!

Thanks Steven, for pointing me in the right direction. My assumptions about the applicationDomain for any loaded SWF was entirely wrong. I really have no idea why I assumed everything was added to the system domain as SWF's are loaded into the app. So what I have done now is define the application domain of any Loader object's context.

var context:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain );
loader.loader( request, context );

This has eliminated any type coercion errors when loading SWF's and has allowed me to refer to them as a strongly type object. Thanks again Steven. And, man, I really need a new code formatter.