Archive for the 'Flex' Category

Mate, an unobtrusive Flex application framework

If you are tired of application frameworks that tie your code together and makes it an unwieldy mess, take a look at Mate.

Mate is quite unintrusive, lets you configure your application declaratively in MXML and does most of the boring things for you. Judging from the documentation and examples it looks like good competitor in the less-than-crowded marked of Flex application frameworks.

The core of Mate is something called the event map which describes what should happen when your application dispatched events of different types. For each event one or more handlers can be invoked. A handler can be everything from calling a method on an object, running a command or invoking a remote object call and there is room for writing your own specialised handlers. Handlers can also run in sequence and get hold of the previous handler’s result, which makes it possible to create quite complex logic. All this is done in MXML, which means that your configuration is also the actual wiring of your application — and it’s readable and quite easy to understand.

My only objection is how Mate handles updating of views. If I understand it correctly, there are two ways, either you have an injector which looks up the view and pushes values into it, or you have an instance of a dispatcher in your view where you listen for result events and update accordingly. Both remove the benefits of bindings, and while they are certainly better than the global variable lookup of other Flex frameworks, I’m not sure I like them. On the other hand I think you can skip that part and inject the model into the views directly. On the third hand, injectors can potentially make your code more decoupled.

Update: see comments below for a clarification on this issue by the framework’s author.

How to save $149

Some jokers who call themselves flexinmotion have released a ridiculously overpriced Flex component which “will automatically track all user navigation clicks, button click, check boxes, radio buttons and a number of other controls within your app automatically” using Google Analytics. Let me show you how to save those 149 bucks.

Read the rest of this entry →

Architectural Atrocities, part 9: Cairngorm’s Model Locator pattern

From time to time I re-read the introductory articles on Cairngorm just to remind me of why I don’t use it and never will. This installment of the Architectural Atrocities series is a critique of the Cairngorm framework, and the Model Locator pattern in particular.

Read the rest of this entry →

Separating event handling from event filtering

One thing that bugs me with event handling is that usually I’m not interested in every event that comes my way. This makes my event handlers more about filtering events than handling them — for example checking that shift is pressed when a KeyboardEvent comes around, or checking that a MouseEvent is above a specific area of a panel. To separate the concerns of filtering and handing I’ve come up with some AOP-like looking ActionScript. Read on for the full explanation.

Read the rest of this entry →

Creating specialized compilers with the Flex Compiler API

Included with Flex 3 is the “Adobe Flex 3 Compiler API”, a little-talked-about piece of code that lets developers create custom Flex compilers, embed the Flex compiler into other applications or just about anything imaginable. In this post I’m going to show how to use the compiler API to create a specialized Flex compiler that can be used to compile font packages for runtime loading of fonts.

Read the rest of this entry →

Quick tips to speed up your Ant build

For those of you using Ant to build your Flex applications, here is a quick tip to speed it all up. If you have a build script that builds more than one SWF or SWC, instead of building everything everytime you can use Ant’s uptodate task to have the script skip running targets whose sources haven’t changed.

Read the rest of this entry →

The hours that 10.5.2 took

For two days I’ve had lots of problems with the Flex application I’m working on. Mysterious behaviour that doesn’t register any errors anywhere. I couldn’t understand what was going on until today when I accidentally right-clicked on the application. Seconds later my hand collided with my forehead and a long sigh could be heard.

It turns out that the 10.5.2 update for Mac OS X silently installed a new version of Flash Player, overwriting the debug version I had installed. Combined with the Font Explorer X problems and weird glitches and two complete system hangs that also came with the update I can tell you that I’ve lost too many hours of work because of that fucking update.

This week’s non-issue: Google indexes SWF files

It’s probably the number one topic on Flash blogs today: O’Reilly launches InsideRIA and has an article about how Google indexes SWF files. As usual when it comes to SEO and Flash, almost no one understands what it means, but almost everyone talks about it as the New Big Thing. Guess what? It’s not. Read the rest of this entry →

Flex Compiler API

This is really great: Flex Doc Team: Java-based Compiler API. It’s the Flex compiler exposed as a Java API, which means that finally someone (perhaps I) can write a set of proper Ant tasks for Flex.

Read the rest of this entry →

The inflexibility of Flex styling

Flex’ CSS implementation isn’t very advanced and it gives me all kinds of trouble when I try to re-style my applications. For the most part Flex does a really good job of allowing customization, but it’s only good for the first 80%.

Read the rest of this entry →