In AS3 it is pretty easy. You will want to relace the traces here with your code, but it would be like this:
Code:
function main():void
{
stage.addEventListener(Event.DEACTIVATE, windowNotActive);
stage.addEventListener(Event.ACTIVATE, windowActive);
}
main();
function windowNotActive(e:Event):void
{
trace("NOT ACTIVE");
}
function windowActive(e:Event):void
{
trace("ACTIVE");
}
When the Flash areas has the focus then you will see "ACTIVE" in the output window, when you click outside the output window will say "NOT ACTIVE". Just put the functions in your script where you need them, and add a pause effect into the windowNotActive function.
Bookmarks