The source code and demo app for this article are linked at the bottom of the post.
I'm a slacker, I admit it. When Flex 4 SDK beta was released at the end of 2008, I gave it a whirl and built a small app. I found the learning curve a bit steep for me at the time, with everything else I had going on. The SDK was also changing a lot and I didn't feel I had the time or energy to keep up the pace.
Last week I decided to finally give the SDK a new try. I am building a new AIR app and wanted an interface similar to Windows, where a user could have multiple "mini-apps" open at the same time and manage these much like a Windows session. I felt it was a perfect opportunity to leverage Flex 4 and AIR 1.5.
At first, getting up to speed was a bit rough. Certainly, Flex 4 is a shift in thinking. One can be lazy and leverage the Halo component set. However, it was my goal to use Spark almost entirely for the project. I had two reasons for this: 1. I want to get up to speed with Spark as fast as possible. 2. I wanted to take advantage of the enhanced skinning and performance of the Spark components.
The most frustrating aspect of this was the lack of documentation. There are beta docs, but they are not up to date and I constantly found myself trying to use properties that no longer existed. I also found a number of blog posts and tutorials. Many of these were very helpful, but since the SDK changed considerably through the beta some of the info was also out of date. I have to thank Simeon Bateman for his work on the "Title Window", I borrowed heavily from this for my own panels. Thanks Simeon!
I'm really liking the new SDK. It feels right. I feel like I have complete control over my skin, and I really feel like it's forcing me to better application architecture. Also, although I haven't had the time to really profile the app, it feels more responsive and more performant. I'm really looking forward to doing a lot more Flex 4 work.
Im posting the code and the demo AIR file for anyone to use. I'll explain a few things, so you can get a feel for what's up:
- The app requires the Swiz framework: http://swizframework.org/
- The menu system is built using two collections: systemMenuItems and programMenuItems. New menu options can be added in the com.funmappr.model.StartMenuModel.
- StartMenuModel creates menu arrays from MenuItem model, which allows you to configure window options. The intent is to eventually have the system use these options to know what to insert into the panel contents.
- Window options should be self explanatory, but basically you can do the following: Set how many instances of a window can be open, set the dimensions of a window, set window title, provide icon for menu item, sort order (not yet implemented), set if window is resizable.
- This is very proof of concept. I will be adding in new functionality over time, but I am not sure I will be sharing those versions. Essentially, this package is licensed under Apache 2.0. If you want to make changes to it, feel free. If you use my work, please give me credit.
- I don't provide support (unless you want to pay my rate!), but I'll be happy to answer questions as I have time.