Archive for 'tips'

HowTo create your developer ToolBox with Mixins

In this post I’ll explain how you can develop a flex library that automatically initializes itself avoiding developers the hassle of remembering how, when and where the libraries need to be initialized and hooked into the application. This can be particularly helpful for debugging libraries like fxSpy, DeMonsterDebugger, KaptInspect, mrdoob, etc. and extremely useful to [...]

Global Exception or Error Handling in Flex

In this post I explain how you can catch unhandled exceptions or errors globally in a declarative mxml-based way using the [Mixin] flex-specific metadata tag.
Starting on FP 10.1 and AIR 2.0 you can capture unhandled exceptions or errors globally. Although you can use these new APIs you should always take care of the exceptions where [...]

Properties file based configuration mechanism for Parsley

In this post I introduce a new mechanism for Parsley to load part of a Context from a properties file. This way highly dynamic of changing properties can be managed externally from the properties file, avoiding the verbosity of an XML approach. As always, the source code is attached.
One of the things I like a [...]

String Templating in Flex

When working with String templates, code can easily become quite difficult to read and, consequently, to understand, maintain and modify. This blog post explains 2 techniques that can help you dealing with String concatenation and templating: StringUtil.substitue and [Embed] compiler directive.
For simple String concatenation like:
var value : String = "The value " + user + [...]

DualPanel Reversible Component

This week I’ve been discussing with Alberto from undefined.es different ways to implement a reversible panel. Basically a reversible panel would be a 2-sides panel. In the front part you could have the component or widget and in the back you could have a configuration panel (same concept as in the OSX Dashboard widgets).
One way [...]

Disabling Bindings on certain Views to avoid unnecessary processing time

Once a view has been created, Bindings will always be active no matter if the view is invisible or removed from Stage.
There might be cases when a View is constantly receiving Binding updates (i.e. connected to an LCDS server with big amount of data transfer or messages). Imagine the view that is processing all the [...]

Some thoughts on constructor and method parameters

I consider a best practice to keep to the minimum the number of arguments a method accepts. As uncle Bob explains in his “Clean code” book we should always favour niladic (no arguments), monadic (1 argument) or dyadic (2 argument) methods and avoid whenever possible methods with more than 3 arguments, if not possible we [...]

Using BlazeDS from a Flash or AS3-only project

Some weeks ago I had to develop a light version of an existing Flex application. The Flex application consumed lot of Java logic through services exposed by BlazeDS’s RemoteObjects.
The goal was to be able to consume, from the new application, the exact same Java Services that the Flex application was consuming through RemoteObjects without [...]

Does an EventDispatcher have subscribed listeners ?

Lately I’ve been reading several discussions around the internals of EventListener, how easy is to create memory leaks, the dependencies between IEventListener and EventListener and onther fancy things. Robert Penner has lots of details around these topics in his 2 part articles:

Critique of as3 events part 1
Critique of as3 events part 2
My new as3 event [...]

Logging and catching (async) exceptions during invalidation

Sometimes, due to many different reasons, there’re exceptions that happen during the invalidation/validation cycle of the flex SDK. Most times these exceptions end up being unveiled in the very core of the SDK, being not possible to catch them up because their async nature and the place where they happen.
The stacktrace of these exceptiosn, normally, [...]