Comments on: Static Code Blocks in ActionScript! http://www.adamflater.net/2007/03/02/static-code-blocks/ Tech, UX, Design Wed, 04 Jan 2012 21:31:56 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Jim Cheng http://www.adamflater.net/2007/03/02/static-code-blocks/#comment-12 Jim Cheng Fri, 02 Mar 2007 20:39:00 +0000 http://www.adamflater.net/?p=5#comment-12 It’s used in the Automation Framework classes mainly to register automation delegate implementations to component classes before any instances get the chance to be created. You can do a text search through the framework classes and find all the instances in the mx.automation.* namespace. It’s not all that interesting what they do in their init() calls, but you’ll get the general idea pretty quickly.

The Flex Framework uses this scheme to “beat the developer to the punch” in terms of initialization such that any component instances are ready to be automated as soon as they can be instantiated either via direct ActionScript 3.0 code or through MXML.

It’s a sneaky trick, but can be useful if you’re doing similar things like writing APIs for other AS3 developers where you need to ensure that some critical early initialization routines occur “silently” before they ever get a chance to use your API. For example, installing a logger (such as Adobe’s Automation Framework) would be a perfect use case for this.

]]>
By: Adam Flater - effectiveUI http://www.adamflater.net/2007/03/02/static-code-blocks/#comment-11 Adam Flater - effectiveUI Fri, 02 Mar 2007 20:22:00 +0000 http://www.adamflater.net/?p=5#comment-11 Jim knows about the magic… I’ll see if I can get him to commment.

]]>
By: [ andy.mcintosh ] http://www.adamflater.net/2007/03/02/static-code-blocks/#comment-10 [ andy.mcintosh ] Fri, 02 Mar 2007 20:17:00 +0000 http://www.adamflater.net/?p=5#comment-10 Yeah… what Tony said. I’m assuming the [Mixin] meta-data tag is what’s working the magic here? Do you know any more about it?

]]>
By: Tony http://www.adamflater.net/2007/03/02/static-code-blocks/#comment-9 Tony Fri, 02 Mar 2007 20:02:00 +0000 http://www.adamflater.net/?p=5#comment-9 Interesting…

Can you comment on the uses of the [Mixin] “annotation”?

]]>