Exactly, Event.DEACTIVATE is the standard solution. Maybe, pol2095 you are referring to NativeApplication event? But it is not needed, you should add Event.DEACTIVATE to your stage, right in your Main:
stage.addEventListener(flash.events.Event.DEACTIVATE, deactivate);