Grant Skinner

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

@gskinner

GDispatcher bug fixed.

I’ve uploaded a new version of GDispatcher that fixes a small error in the code that was causing a compiler error.

You can download the new version here (1kb).

There should be a beta 2 release in the next day or so, as I mull through some major compatibility issues with the highly discombobulated UIEventDispatcher class. Some days I wonder if Command HQ doesn’t go out of its way to make things overly difficult for us guys in the trenches – the v2 component framework seems to be irrefutable proof of it

[code] GDispatcher: Event swiss army knife.

A few posts back, I mentioned that I was planning to extend the EventDispatcher class to add some features that I wanted. I quickly realized that to satisfy my needs, I would need to do a full re-write, and GDispatcher was born. Being the generous fellow that I am ;), I thought I’d share it with the community – read through this post to download it.

GDispatcher is a new event dispatching class for ActionScript 2.0. It fully implements the EventDispatcher interface, allowing it to be interchanged easily (yay polymorphism!). Beyond the basic functionality found in EventDispatcher (described here), it also supports these new features:

  • Listeners can subscribe to all events from a dispatcher
  • Listeners can specify a function to handle specific events, or all events (within the scope of the listener)
  • Can check if a listener is already subscribed to an event
  • Can remove all listeners for a specific event or for all events

Continue reading →

Event dispatcher, the next morning

Ok, I have to post a bit of a retraction. While EventDispatcher is still a big improvement over previous event models, it’s not quite as cool as I thought it was at 3am last night. Nothing ever looks quite as hot the morning after, does it?

The ability to subscribe functions or methods to events is made vastly less useful than I excitedly thought last night by the fact that the function will, of course, be executed within the scope of the object dispatching the event (duh). This means that really, this approach is only about as useful as a callback event handler (the functionality is virtually identical) – its occasionally handy for quick’n’dirty prototyping, but usually not good form.

Ahh… the murky clarity of 3am experimentation. Oh well, stay tuned, I hope to build out an extended version of the eventDispatcher that includes some nifty new tricks.

Using eventDispatcher (it rocks!)

In many respects, I haven’t been overly impressed with the F04 (Flash MX 2004) update, though I’m reserving my final opinion for a month or so, until I’ve really dug deeply into it. Tonight though, chatting with Phil Chung, I ran into something I’m really impressed by: eventDispatcher

I thought I’d should provide a run-down of it here, as it appears well thought out, and very flexible (though I’ll probably write an extension to it to fulfill my short wishlist of missing features). Whoever thought this one up at Macromedia should be proud.

Read on…
Continue reading →

More OOP4AS2 translations

Thanks to some wonderful multi-lingual Flashers, the Object Oriented Programming for Actionscript 2.0 series of posts is being translated into a plethora of languages. Currently, translations have begun in:

Korean

French

Latvian

Chinese

Spanish

Dutch

German

Brazillian Portuguese

Links should also be available to the individual translated articles in the comments section for each entry (I have asked each translator to provide these). If you find these translations valuable, please send the translators some encouragement in their comments, or by email. Thanks guys!

If you’re interested in doing a translation, just fire me an email with the “contact” button at the top of the page.

EDIT: added French, 2003/09/21

EDIT: added German, 2003/09/22

EDIT: added Brazillian Portuguese, 2003/09/23

OOP4AS2#5: Inheritance (extends and super)

Entry #5 in this series will deal with implementing class inheritance with the “extends” and “super” keywords. In this post, I will focus on the syntactic details of inheritance in ActionScript 2.0, and will likely post my opinions and thoughts how to apply that syntax separately.

Inheritance is a very important concept in Object Oriented Programming, as it allows for the development of highly modular and extensible code, which in turn reduces development time. It also allows developers to extend the functionality of pre-existing classes, without touching the original code.

Once again, this post builds on previous posts, so at the very least you should grab the code from entry 4 before proceeding. Also, if you’re looking for a great introduction to all the new goodies in F04 (Flash MX 2004), be sure to pick up the forthcoming “FlashMX 2004 Demystified” from Macromedia Press.

Read on…
Continue reading →