Signals may spell the death to my Commands as I know them
Back when I wrote my Command library I was doing a lot of calling of commands. It actually stems from the Commands/Delegates I created for the Facebook AS3 API (which have since been removed; which I think is a shame). Essentially the greatest benefit I got from my commands with the ability to do this:
function onComplete(commandInstance:CommandClass):void
{ // do stuff }
instead of this:
function onComplete(e:Event):void
{
var commandInstance:CommandClass = e.target as CommandClass;
commandInstance.removeEventListener(Event.COMPLETE, onComplete);
//NOW I can do stuff
}
That got rid of a lot of code for me and made me very happy.
Boss: Jason, how many lines of code did you write today?
Me: (proudly) Negative two-hundred-sixty-nine!
Just kidding. My boss has never asked me how many lines of code I wrote.
Read more
Introducing: The Peanut Butter Logger (Flash-friendly AS3 logging)
The Flex logging framework is pretty cool. For an old skool Flash Hack like me it was a huge step up from the trace() that was pretty much our only tool back in the day. Some of us rolled our own solution in the AS2 days and there were even a few projects around the idea. But there was never a great way of getting our important debugging info to a helpful place.
And of course the Flex logging framework is for . . . Flex. I have a bitter-sweet relationship with Flex and the fact that the logging framework isn’t something that’s uber-portable is a little frustrating. But no matter; there was enough I didn’t like about the framework so it was an even better opportunity to roll my own.