Grant Skinner

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

@gskinner

Understanding the Delete Keyword.

In the comments of my previous post about how the garbage collector works in Flash Player 9, Cédric Néhémie asked a great question about why using delete on a property of a sealed (non-dynamic) class throws an error in ActionScript 3, and whether it will delete the actual object in memory.

There isn’t a lot of documentation on this topic, and what there is is hard to find, so much the following is conjecture and interpolation from related exploration, but I think it is fairly accurate. If not, please let me know in the comments – I don’t want to lead anyone astray.

My understanding is that the delete keyword deletes the actual variable definition, not just the variable’s value. This of course frees any reference it was holding, potentially freeing that object for garbage collection (as described in my previous article). It will not delete the referenced object from memory directly.

Continue reading →

AS3: Resource Management pt 1

I’ve been playing around with AS3 for a while now, and am really excited by its capabilities. The raw execution speed by itself will create so many possibilities. Toss in E4X, Sockets, ByteArrays, new display list model, RegEx, a formalized event and error model, and a few dozen other features for flavour, and you have a pretty heady brew.

With great power comes great responsibility, and this will be very true for AS3. A side effect of all this new control is that the Garbage Collector is no longer able to make as many assumptions about what it should tidy up automatically for you. This means that Flash developers moving to AS3 will need to develop a very strong understanding of how the GC operates, and how to work with it effectively. Building even seemingly simple games or applications without this knowledge can easily result in SWFs that can leak like a sieve, hogging all of a system’s resources (CPU/RAM), and causing the user’s system to hang (potentially even forcing them to hard reboot their computer).

Continue reading →

Types in AS3: ints not so fast, uints slow!

UPDATE: These findings are not relevant in more recent versions of the player. Please see this article for more recent results, and to run the tests for yourself.


Sho just posted a really interested article on why he won’t be using the int data type very frequently in ActionScript 3. Up until reading it, I had believed that as in other languages, there were large performance benefits to using ints and uints appropriately in AS3. Turns out that isn’t the case.

I did some quick testing on this, which confirm Sho’s assertion that int is only slightly faster than Number in ideal circumstances, but the results from uint were much more surprising.

Continue reading →

Mactel and Adobe, One Week Later

It has been about a week since I got everything set up on my new MacBook, and I thought I would write up a quick post to let everyone know how things are going with the new system.

Hardware setup

First, let me briefly describe my setup. For hardware, I have my new white 2.0ghz MacBook, with 100GB HDD and 2GB RAM. I connect it to a 23″ Apple Cinema Display at home, and a 17″ Sony LCD at the office with monitor spanning between the MacBook screen and the external monitor (ie. two monitor setup, not mirrored). I also use an external mouse/keyboard in both locations. I chose to keep the larger display at home because I tend to handle a lot of managerial / business stuff at the office, and do more intensive coding at home. As with all Macs, the MacBook does a perfect job switching between different monitors and peripherals, remembering resolutions and settings for every location. A docking station would be nice, but I can live with plugging in 3-4 cables (power, monitor, USB, audio) at each location.

Software setup

For software, the MacBook is running Mac OS 10.4.6. I have Flash MX, 2004, and 8 installed for Mac, as well as PhotoShop and the Mactel native Flash Player 8. Using Parallels virtualization software, I am also running Windows XP Pro SP2 with Flash 8, FlexBuilder 2 and the Flash Player 9 beta. I would definitely recommend reading the at least the Quick Start guide if you plan on installing Parallels VM – not all of the options are entirely straightforward.

Continue reading →

Adventures with Adobe and an Intel Mac – Part 1

I recently decided to purchase an Intel Macintosh for my main work system, despite there being no native binaries for the software that I use most often: Macromedia Flash and Adobe Photoshop. There was a few reasons I decided to take this plunge:

  1. My 12″ 1ghz Powerbook was far too underpowered to do daily work on, or even to use for training / presenting at conferences.
  2. I work at home, the office, and while traveling. I was sick of trying to synchronize 3 computers, and more than a little bit worried about overwriting the wrong file.
  3. There was no way I was going to shell out major coinage for a new powerbook that wasn’t using the newest processors.
  4. Bootcamp/Parallels should (more on that later) let me run Windows versions of the software I need when I require good performance.
  5. The new Macbook is just a ridiculously good deal in terms of price/performance/features, especially by Apple standards.

Continue reading →