views:

23

answers:

1

What would be the best way to go about building an Adobe AIR app that doesn't have any windows (i.e. exists only in the system tray / dock)? I noticed that the default base tag in Flash Builder is <s:WindowedApplication> which seems to imply there'll be a window.

Should I just use <s:WindowedApplication> and call window.hide()? I saw there's another base class, <s:Application>, but I got the sense that was more for files that run in the browser. It seems like using window.hide() would briefly flash a window when the application starts which could confuse users. However I'd also ideally like to retain the ability to have the app open a window later if needed, or also to change the application from tray-only to windowed through an update.

A: 

You need to edit the app-config file to enable transparent chrome and visible = false. Then you need to change the WindowedApplication tag to and app your custom skin. You need to add control buttons for close etc, since that functionality isn't present in a web-app (since you have changed the tag). Also you need to add drag functionality. If you like to make your application re-sizable you need to add that too, manually.

jase21
Thanks for the response, but I'm not looking to have custom window chrome - I'm looking to get rid of the window entirely (and to just show a tray icon instead, but I figured out the tray icon part). The closest I've come is setting `window.visible = false` on initialization, but that causes the window to flash open briefly and I'd like to avoid that somehow if possible.
Alan
In your airAppName-app.xml file, set "systemChrome" to "none", "transparent" to "true" and "visible" to "false".
jase21
I actually just found the "visible" option in the -app.xml file and got excited, but for some reason AIR seemed to ignore it - it still showed the window despite setting everything you mentioned. I'm using AIR 2.0, maybe it's deprecated or something? Anyway, I just discovered that adding `visible="false"` to my `<mx:WindowedApplication>` worked, so it's finally solved. Thanks!
Alan