Christophe Coenraets posted an entry on his blog demonstrating four different techniques to write a simple temperature converter application.
The purpose of the entry was specifically to demonstrate four different ways to accomplish the same thing–showing how flexible Flex really is. The goal for this application was to separate the ActionScript out of the MXML files.
I’d like to follow up on this entry and demonstrate a fifth approach. This is something one of the Flex engineers proposed earlier and in my opinion is the cleanest method. Instead of using an <mx:Script> tag and including functions that get dropped into the current class, we can create a Controller class and link it through tags. This keeps tags in MXML, ActionScript in external files, promotes OOP programming, and simplifies reuse.
Continue reading ‘Separating ActionScript from MXML: Approach 5′