Ok, so Flex 3 and thus AIR 1.0 are now out to be used and abused. You’d think I would have been posting like crazy as soon as they hit the shelves. So what have I been doing? You guessed it – using them. I’ve been deep in the world of Trees, ContextMenus and MVC design patterns. I’ve been learning how to use the File class and drag and drop functionality for the desktop. I also broke down and became an Adobe Certified Flex Developer, so now I have something to work in conversations at dinner parties.
I would feel bad if I wrote a post and didn’t provide a tidbit of usable information for the flex community, so how about something I learned about AIR application icons.
To give your AIR application an icon, which you should always do to avoid the default icon being used by the OS, you need to specify the image location for the icon in the <application_name>-app.xml file that will be in the root of your AIR project folder. There are four tags for the icon, and if you don’t use one, you need to remove it. That’s something that got me, although it seems fairly obvious looking back. The compiler won’t automatically look at a tag without an image reference in it and say “hey, I should ignore this”. So either create a png image to use for each of the 16px, 32px, 48px, and 128px icon references it has OR specify one of them and delete the other tags. I recommend creating an icon for each since it’s really not that much more effort and will allow you to tweak the icons to look better for smaller and larger sizes.
Have you wondered how AIR can make icons for both the Mac and Windows platforms? Well, the icons aren’t created until you install the application. At that point, the installer knows what platform you’re installing to and will generate the appropriate icons at that point. Because of this, you won’t see your icon when you’re developing and debugging the application. The icon will only show up when you install the application from a release build.