How to execute code before closing the application? I tried:
import flash.display.*; import flash.events.*; stage.nativeWindow.addEventListener(Event.CLOSING, onClosing); function onClosing(e:Event):void { e.preventDefault(); trace('работает!'); }
It produces errors:
1119: Access of possibly undefined property NativeWindow through a reference with static typeflash.display:Stage. 1119: Access of possibly undefined property CLOSING through a reference with static type Class.
What is the matter I can not understand.
ActionScript 3, Flash Player 11.2.