A simple AIR app for watching Hurricanes
All of us in central and southern Florida are doing our yearly ritual of watching the weather channel and preparing for this year’s first hurricane threat, Hurricane Fay. As you can see on the map below (as of 5pm EDT today), I am very near the projected path. This past weekend, we started going to the National Hurricane Center website regularly to see how things are shaping up. I had a little spare time last night and decided to write a little AIR app for my family and Florida friends. At first, I had no intent of blogging about the app since it’s really just a simple tab interface to 4 mx:html components…but after finishing the app and seeing the reaction, I decided that it might be worth sharing since it was so easy to build.
I basically wrote this thing in less than an hour using the following steps:
- I located the images I wanted to show – most of which are from the National Hurricane Center page
- I created a new Flex project in Flex Builder and chose “desktop application” as the app type
- I chose the TabNavigator component combined with a HBox and a VBox to lay things out accordingly
- I used an HTML component for each of the tabs
- I created a simple ActionScript timer and supporting method to handle auto-refresh of the html components and a countdown timer
- I then added a few useful options like “quit”, “always in front”, etc.
- I chose a simple move effect and wrote a little ActionScript ot handle the slide-in, slide-out effect when the window is clicked
- I took a screenshot of one of the hurricane center images and created the required icon files, 128×128, 48×48, 32×32 and 16×16
- I created a quick install badge using http://labs.adobe.com/wiki/index.php/AIR_Badge
- I then did a little copy/paste from my previous article on adding auto-update capabilities
- I then emailed a few family and friends to share my little app
You can try the app here:
As new hurricane’s come into focus, I can simply create a replacement app and push it out.
Source CodeVodpod videos no longer available.
Suggestions welcome 🙂
08/25/2008 – Updated for Hurricane Gustav. Also, more panels added.
08/29/2008 – Updated for Hanna – implemented a simple ViewStack. I’m thinking I should make the list of URLs that build the panels external so I don’t have to update the app every time a new storm comes to play.