Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if the swf has been unfocused in AS3

I just thought it would be useful to know how to check if an swf has been focused or otherwise. This situation arises when the end user clicks outside of the stage (on the address bar of the browser, for example).

like image 485
Olin Kirkland Avatar asked Nov 23 '25 03:11

Olin Kirkland


1 Answers

stage.addEventListener(Event.DEACTIVATE, notFocused);
stage.addEventListener(Event.ACTIVATE, focused);
function notFocused(e:Event) {
    trace("Not focused");
}
function focused(e:Event) {
    trace("Focused");
} 
like image 170
Olin Kirkland Avatar answered Nov 24 '25 23:11

Olin Kirkland