Can flash detect loss of focus?

Specifically - can Flash perform an action when it detects the user has click out of the aplication OR web browser it was embedded in?

I read a few ways that I could maybe pass the information from javascript but that seems clunky and may not even do what I want.

Imagine if you only wanted a movie to play and when the user clicks out of the flash it pauses it.

Any ideas? Been looking at FocusManager but it all seems individual component based - maybe I’m missing something obvious.

Thanks for any help (I did a search but to no avail)