(Go to ‘Cairngorm Series‘ to view all titles)
This is the second post in a series on Cairngorm fundamentals. We will be covering the concept of the ModelLocator, the Model in MVC. In short, the ModelLocator is a Singleton which implements a marker interface (no method definitions) from the Cairngorm framework called com.adobe.cairngorm.model.IModelLocator. The ModelLocator class defines properties that hold all application data. From now on we’ll just call this class the Model.
Continue reading ‘The ModelLocator Holds Application Data’
(Go to ‘Cairngorm Series‘ to view all titles)
This is the first post in a new series on Cairngorm fundamentals. I begin the series with three steps towards a Model View Controller implementation using familiar concepts and no framework. Future posts will build on these concepts using the Cairngorm framework until we have built a working application.
Continue reading ‘Moving towards MVC without Cairngorm’
I’ve been searching for a way to write view code in my Flex & AIR projects that is completely reusable, scalable and simple yet powerful. I’ve read about and used the questionably named ‘code-behind‘ techniques that Ted and Adobe promote. I’ve tried the ‘script src‘ technique that Tink is passionate about. I’ve used ‘view helpers‘ and I’ve even tried the rarely discussed ‘code-in-front‘ technique that Marc has written about. However, I’ve recently been creating my views with a technique I call the ’simple’ method which is in the same school of thought as Marc’s idea. Here’s a table that describes the five methods mentioned above for creating views in Flex:

Continue to try out each technique in a Flex application with source and find out why I especially like the all MXML ’simple’ method …
Continue reading ‘Flex View Component Techniques in MXML & AS’
This post is an extension of an earlier post entitled “Flex Part 02: Value Objects & Model Objects“.
Recap: Model Objects are similar to Value Objects in that they hold the same data, except that the Model Object is responsible for making sure that no ‘bad’ data gets into the VO. The Model Object enforces business rules like, “phone must be at least ten digits long” which a VO cannot do on its own. A Model Object may even include methods for easily manipulating properties.
In the earlier post I presented some example code for a Model Object. It turns out that what I provided is a pain to maintain over time. There’s just too much duplication and poor use of public properties. Continue reading for my attempt at a better, easier Model Object …
Continue reading ‘Flex Part 02+: A Better Model Object’
To view the connect presentation, click here (1 hour 20 min).
Ben Stucki delivered a great presentation last night to the Nashville (615) Flex user group. The topics were Degrafa, an open source declarative graphics framework for Flex and OpenFlux, a component model based on MVC (Model View Controller).
The presentation covers MXML syntax as well as complex CSS component skinning with Degrafa. Some of the examples are available on the Degrafa website at http://samples.degrafa.com.
Ben also shows off some of his work on OpenFlux - which looks very cool. If you are interested, skip to around 55:00 in the presentation. Also, check out Doug’s post titled “We’re not waiting for Flex 4” for even more cool info.
Sometimes it is necessary to display a formatted value such as currency or a percentage in a NumericStepper component, but that is not a default behavior. I need something extremely simple that can be written as:
XML:
-
<mx:CurrencyFormatter id="currencyFormatter"
-
currencySymbol="$"
-
precision="2"/>
-
-
<controls:FormattedStepper formatter="{currencyFormatter}"/>
My internet searches turned up this similar attempt, but it seemed overly complicated (just my opinion). Continue reading to view my attempt at a simple formatted numeric stepper with source. I've also included an example of a custom formatter as well as an item renderer / item editor in a DataGrid.
Continue reading 'FormattedStepper extends NumericStepper'
I work on a lot of charting and data visualization applications. Flex is great for these projects, but what happens when a client wants to use a chart (or any DisplayObject) from the application in a document, presentation, website or email? I needed a way to let users save jpeg and png files to their computers without storing any images on the server. The following solution works with PHP but it should be very simple to duplicate the process for other environments. Continue reading to try it out and view code.
Continue reading 'DisplayObject to JPEG or PNG with IImageEncoder'
This post is a continuation of "Distinct Data Providers with GroupingCollection." The code and example is extremely similar - there are a couple minor changes to accommodate one addition: the use of HierarchicalCollectionView.
What's new?
We saw in the previous post that a GroupingCollection works very well for creating a grouped data provider for an AdvancedDataGrid or even for use in part in a List or ComboBox control. But there's a(nother/ better) way to populate that distinct List or ComboBox from the GroupingCollection. Use a HierarchicalCollectionView. It's a more elegant solution and also lets you use your grouped data to populate a Tree or Menu control! Continue reading to try it out and view code.
Continue reading 'GroupingCollection -> HierarchicalCollectionView'
Update: This post is updated and continued in the next post, "GroupingCollection -> HierarchicalCollectionView." Please see that post for additional (better) suggestions.
This post is itself an update to "DistinctArrayCollection extends ArrayCollection." The old post describes the problem and proposes a solution. I did not post code in that article because I felt like there had to be a better way of doing things. Here's a better way (see the update for a much better way): use the GroupingCollection class in Flex 3. Continue reading to try it out and view code.
Continue reading 'Distinct Data Providers with GroupingCollection'

Ben Forta (Adobe's Senior Technical Evangelist) made a stop in Nashville last night to discuss Flex 3, AIR, LiveCycle Data Services and other related topics. The event was held by the 615 Flex user group and sponsored by Dealer Skins, The Dave Ramsey Show, Shuff's Music and Aristoworks. Thank you to everyone for putting on a great show.
Speaking of presentations: I will be starting a short series on Cairngorm at the next 615 Flex user group meeting. The topic will be covered from a beginner perspective. Contact me or check out 615Flex.com for more details.