clarkk
clarkk

Reputation: 27685

Check if SWF has focus

How can I check if a SWF element on a page has focus?

In IE, onkeydown events are not detected in JavaScript if a SWF has focus but Firefox always detects onkeydown.

Upvotes: 2

Views: 409

Answers (2)

nicoptere
nicoptere

Reputation: 1069

I think there is an Event.ACTIVATE triggered when flash gets the focus. you can also listen to a MOUSE_OUT on the stage to check when flash loses the focus.

Upvotes: 1

invisible bob
invisible bob

Reputation: 864

Detect it with Javascript? Javascript has onFocus and onBlur events,

var hasFocus=false;

DomElem.addEventListener('focus', function(e){
    hasFocus=true;
},false);

DomElem.addEventListener('blur', function(e){
    hasFocus=false;
},false);

I'm not sure about how to do it in AS...

Upvotes: 0

Related Questions