Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

Building the V3 Components for Flash 9

I’m really excited to finally be able to talk about the fact that we are working on the v3 components for Blaze (Flash 9) together with Metaliq and Adobe.

At the FlashForward Austin keynote, Mike Downey showed a number of new features in Blaze (Flash 9) including enhanced PSD (PhotoShop) import (yay!), new timeline tweening to actionscript functionality (looks super cool!), and the new component set built entirely in ActionScript 3. That means that I can now tell people what I’ve been so busy working on, and why I’m not blogging much or releasing new experiments on gallery incomplet. [Moved to incomplet.gskinner.com]

I can’t talk about specific details yet, but I can say that we are applying everything we learned about developing fast, light components from mCOM/GLIC to this new set (don’t worry mCOM owners, the v3 documentation will be a LOT better than mCOM’s initial offerings). I can also tell you that these new components will be much easier to skin visually, without touching code.

We’re having a blast coding these components, and are really enjoying working in ActionScript 3. There’s still some really frustrating moments, but overall I love the new language – switching back to AS2 is getting more painful by the day. Working with Metaliq and Adobe has been awesome – everyone is really dedicated to the project, and I’m confident that together we’ll deliver the best component set for Flash yet.

Hopefully I’ll be able to post some more specific info soon. In the meantime, I’d love to hear what you’re hoping to see in the new component set.

Garbage Collector Interactive Simulator

This is an interactive simulator I built to demonstrate how the Garbage Collector operates in Flash Player 9. It allows you to diagram objects and references, then see how reference counting, and mark and sweep routines would play out for your scenario.

It’s pretty easy to use. The object tool (round rect) let’s you click on the stage to add a new object, or click and drag an existing object to create a new object referenced from it. Objects display their reference count in real time. The two reference tools (lines) let you create strong and weak references by dragging from one object to another – the arrow indicates the direction of the reference. The selection tool lets you move/select existing objects and select references. I believe the buttons at the bottom are self explanatory, though it’s worth pointing out that Mark and Sweep are separate buttons. You can use the 1-4 keys to select tools, and the delete key to delete selected items.

Continue reading →

Resource Management in AS3 Session Notes Available

I’ve just posted my session notes and source code for my talk on Resource Management in AS3 at FlashForward Austin. You can access them (along with all my other session notes) at gskinner.com/talks. It’s worth taking a look, even if you’ve read my previous articles as it includes simulations, interactive systems, and additional information.

I had a great time in Austin. The city seems to be a lot of fun – lots of good bars and barbecue. FlashForward seems to get better every time, and it was a nice change doing a purely technical talk. As always, it was wonderful meeting up with friends from the community, and meeting new Flash folk.

I should be finishing off the resource management series of articles in the next little while with the fourth installment on solutions and strategies.

Fun With Segway!!

I’ve always thought Segways were really cool, and really wanted to play with one. I even begged to ride the one at the Macromedia offices on a few of my visits, but it was always in another building, or otherwise unavailable (I think they just didn’t trust me with their expensive toy).

So, when Segway called me up and invited gskinner.com to design and build a mini-site for their brand new product line, I jumped at the chance. Work with a super cool, progressive client, building a site for an unreleased techno-gadget? Count me in.

Continue reading →

AS3: Resource Management pt 3

This one took a little longer than I’d hoped – life’s too busy right now! In this third part of my series on resource management in ActionScript 3 I will be focusing on a few new tools in AS3 / Flex2 that let you track and manage memory more effectively. There are only a couple new “official” features that are specifically geared towards resource management, but they are very useful. These are supplemented by a handy unofficial feature, and of course there are lots of language features that can help you in more generic ways.

Continue reading →

AS3: Singletons

In ActionScript 3, class constructors can only be set to public. Adobe has stated that this is because the ECMAScript specification is not yet complete, and they did not want to break forwards compatibility with the specification. This makes a lot of sense, but it leaves AS3 developers without a clear way to implement the Singleton design pattern. Luckily, there are a couple ways of faking Singleton functionality. Both solutions are kind of hack-ish, but they get the job done.

Continue reading →

AS3: Dictionary Object

I think one of the handiest new features in ActionScript 3 is the Dictionary object, which lives in the flash.utils package. It is a new object type that allows you to associate a value with an object key. This is similar to how array associates values with numeric indexes, and how you can use a generic object to associate a value with a string key.

// Arrays use numeric indexes:
var arr:Array = new Array();
arr[0] = "value";
// Generic objects use string indexes:
var obj:Object = new Object();
obj["key"] = "value";
// Dictionary uses object keys:
var dict:Dictionary = new Dictionary();
dict[myObj] = "value";

Continue reading →

AS3: Weakly Referenced Listeners

I will be dealing with this in the next installment of my resource management series of articles, but I thought it was important enough to warrant a quick post in the interim.

I’ve been blogging about how important resource management is going to be in ActionScript 3, and also mentioned that we have some new tools to deal with it. One of these new tools is the ability to have weakly referenced event listeners. A weak reference is one that is not counted by the Garbage Collector (ie. it is not counted in reference counting, and it is not followed for mark sweeping). This means that if the only references remaining to an object are weak, it will be available for collection on the next GC sweep.

References associated with event listeners are often forgotten by developers, which normally results in the listener never being removed from memory. This is why weakly referenced event listeners are so handy in AS3 – if you forget to remove the listener, you will not impede the Garbage Collector’s ability to collect the object.

Continue reading →