Forum Moderators: open

Message Too Old, No Replies

Detect when Flash no longer has focus?

         

Fiasst

8:00 pm on Apr 16, 2007 (gmt 0)

10+ Year Member



Hi,

I have a select form field that I have recreated in Flash to act like an html select form field. I need a way to detect that my Flash movie is no longer in focus (when clicking on the html page) and so, hiding the dropdown options.

If you see the way an html select field works, you can click the dropdown and move the cursor around the screen without the dropdown closing. But if you click anywhere on the page, the select dropdown options will disappear again. I’ve tried different ideas but I can’t find a solution. onfocus in JavaScript isn’t well supported in Safari or Gecko and I’d prefer ActionScript to detect the focus rather than JavaScript if possible.

Thanks in advance!

BlobFisk

1:19 pm on Apr 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried using onFocus and onBlur on your flash object?

Fiasst

4:52 pm on Apr 17, 2007 (gmt 0)

10+ Year Member



onFocus or focus isn't supported in Gecko browsers.

I've found an answer now, it's on Adobe's website under Flash/Actionscript - Username: Realworks.

Cheers.