When you click the doc icon, your app. will receive an invoke event.
You can take a look at this sample app.:
The sample app. behaves the way you want.
No, the sample stopwatch app is not the same because it doesn't use standard chrome (i.e., systemChrome=none). So, it *hides* the window when docked and shows it again when the dock icon is clicked. I can do that too. :)
The problem comes when the CLOSE button (i.e., red bubble) in the standard OS X title bar is clicked. If I allow the event to go all the way through, then I end up with a closed nativeWindow that I can't reuse/show again. If I disallow the event (i.e., use preventDefault), and hide the window instead, I get mostly what I wants, except when one right-clicks on the dock icon and select Quit. On OS X, apparently Quit does the same as CLOSE button in the title bar. However, I don't want them to be the same. When Quit is selected, instead of hiding the window like the Close button, I want to exit the app entirely.
I think the key to what you're trying to accomplish (if you still care 8 months later :-)) is for the base of your app to be an mx:Application instead of a WindowedApplication. Your main Application instance (which need not have a corresponding visual window) could then create all your ui windows as mx.core.Window instances and control their visibility by setting the Window.visible property. This would allow you to handle the Event.CLOSING event for every window separately. It would also isolate the case in which the user quits through the dock icon.
Hope this helps. I've used this arrangement in an app that's been in the wild for over a year now and it's served me well.