Why I hate doLater and waiting a frame

General

The whole method of waiting a frame to allow other functions to complete never sat right with me. It just seems.. broken.
In the MX components, doLater is used a lot - a function for putting off execution of another function until the next frame.. usually to allow other child components to finish initializing before laying them out.

Personally I would have used a cascading series of events, where the child components dispatch an "Ok I'm ready" event. The parent component would listen for these and when all child components are ready, it does its stuff and dispatches its own "Ready" event.

I'd be interested to know what methods other people use to make sure that things like layout get executed in the right order.

Posted by Ash on December 20th, 2005

Filed under General | 9 Comments »

Comment spammers get sneakier

General

I don't usually have a problem with comment spam.. I delete the few that manage to get past the filter. I just got a spam message apparently from a previous legitimate commenter (Mr Peters, I didn't know you'd taken up trying to sell little blue pills). The comment was 'no problem....', but on the last dot there was a link to a dubious site.

Nice try! Too bad it was spotted :)
Read the rest of this entry »

Posted by Ash on November 2nd, 2005

Filed under General | No Comments »

Moving MovieClips in AS3

Discussion

All this new functionality is a lot to take in at the moment, but I noticed something new about the DisplayObjectContainer class (which is inherited by MovieClip). In particular the addChild and removeChild methods which replace the traditional attachMovie.

Does this mean that you can remove a movie clip from one target and place it in another without losing the MovieClip's state?

Theres lots of cool new stuff, and not enough time outside of work to look at it all!

Posted by Ash on October 19th, 2005

Filed under Discussion | 7 Comments »

Flash player 8.5

Discussion

With the upcoming release of Flash Player 8.5, I wonder if the Flash developer community will be able to unlock it's secrets before the Flash 9 alpha, just like they did with Flash player 8. Or did Macromedia go to the trouble of hiding or disabling the new AS3 goodness?

Just a thought.

Posted by Ash on October 14th, 2005

Filed under Discussion | 1 Comment »

Mmm.. buttons

Actionscript

Heres a sneak peek of the button from my upcoming (eventually) Razor component set. It needs flash 8 (for now, I have flash 7 versions planned).

Try clicking it a few times.. neat huh? :)

Posted by Ash on September 26th, 2005

Filed under Actionscript | 2 Comments »

Useful livedocs page

Hot

Thought I would make an obligatory 'omg Flash 8 is out!' post to join one of the 5 million that will be on MXNA today :)

But I'll add something extra for codemonkeys like me:

Handy page on livedocs detailing all the new actionscript goodness

Have fun!

Posted by Ash on September 13th, 2005

Filed under Hot | No Comments »

Back it up!

Discussion

My laptop hard drive died the other day. I tried various recovery tools but I couldn't even get my bios to detect it when I connected it to my desktop. Bleh!

So in addition to the cost to replace the drive, I lost a game I've been working on and some irreplacable photos downloaded from my camera. But still, I have no-one to blame but myself!

So here is a friendly reminder that if you don't have an automated process to back up your stuff: Go back up your files.. right now.. no excuses!

Posted by Ash on August 17th, 2005

Filed under Discussion | 1 Comment »

FP8 Security settings

General

Is it me, or do the security settings at the following url just not persist with the FP8 beta?
Clicky.
I'm trying to get the Flash Comm server administration panel to run and failing miserably because FP8 won't let it connect.

Are the settings just not updated yet because it is a beta?

Posted by Ash on August 12th, 2005

Filed under General | 2 Comments »

AS2 Lazy Construction Weirdness

Actionscript

Update: (See comments) I completely forgot that subclasses call the superclass constructor by default. Don't I feel dumb right now. But I'll leave this post here as an exercise in pointlessly using __resolve to decorate classes on-demand. :D

Consider this strange example. I have a class, called Widget. This class contains core code for handling all kinds of Widgets. Other people will be extending this class to create their own varieties of Widget (BendyWidget, SpinnyWidget).

Now, in my core class I want to add EventDispatcher functions, so I can dispatch certain core events like "exploded".
Cool, I'll just put the code in Widget's constructor function and everything is good, right?

Now what if my Widget constructor never gets called because I can't rely on the creators of BendyWidget to call super(); in their constructor function.. how can I guarantee that my class will have the event dispatcher functions?
Read the rest of this entry »

Posted by Ash on June 14th, 2005

Filed under Actionscript | 8 Comments »

Razorberry Recommends

Discussion

I'm not usually one to buy geeky books. I often prefer the free wealth of information provided by the interweb. The other day though, I bought the book shown below. Head First Design Patterns.

Most flash books don't teach me anything new, and I don't want to buy a whole book just to learn one or two new things, so I thought I would read up on more general coding practices.

The book explains the principles of using design patterns and then takes you through a number of the more common patterns you can use. But it does this in an entertaining and easily understandable way, with examples and stuff for your brain to do other than just read paragraphs of text. It's very easy to dive in to.

The code examples are in Java, but if you know Actionscript 2 then you really don't need to worry, you'll find them easy enough to understand.

Head first design patterns [amazon.com]

Posted by Ash on May 24th, 2005

Filed under Discussion | 1 Comment »