Actionscript - Focus Question - HELP

FLASH Version 5.

I have 4 different frames in a browser, three containing a movie, one is plain HTML.

I want to determine when a FLASH Movie has lost focus ( within a Browser window ) I have tried 40 things and nothing works consistently.

Rollout doesn’t work consistently and is additionally not a viable option.

Checking the mouse position doesn’t work either, since when I leave the movie, I get the mouse’s last position within the movie.

I tried using Javascript within the frame to figure out when the javascript window has lost focus ( onBlur event handler) - But Javascript considers that the frame loses focus when the user enters the movie :wink:

Any ideas?

Thanks,

Tristan

you could look into inter movie communication via javascript. then send a message to every other movie on a roll over, or an onFocus for the html frame.

kind of a hack though. good luck.

I am controlling all of the movies via Javascript. I have three menus - one for products - one for company information and one for the navigation - and close the other two when a subject in the third is selected.

Take a look at http://knappmedien.kicks-***.org

Which is the project in question. I always want the current menu to be the page which is being shown.

Each page updates the status of the other movies via Javascript - but if you “play around” with the status of one movie, I haven’t figured out how to set the state back if the mouse leaves the frame.

Try it out.

“Maybe I should stick to my belief that Flash is a toy for animations and not a complete programming language” - or I am a dumb MoFo… :wink:

Thanks,

Tristan

http://knappmedien.kicks-***.org was edited by the forum.

the real url ist http://knappmedien.kicks-*ss.org

Please substitute “a” for the asterix.

hey don’t blame me - it is a DynIP and I loved the name :wink:

Cheers,

Tristan

yes, and you can’t get a roll out to work because once the mouse is out of the frame, it’s not talking to the movie anymore.

however, the roll overs will always work and they could send the roll out message to whichever clip was last over.

The rollouts don’t seem to work on a consistent basis if the buttons are exactly next to one another (0 pixel between them). The rollover works always and the rollout works 15% of the time.

I am guessing that Macromedia’s event handler lacks multith
reading and only handles the first event which occurs within a given time frame - and apparently rollover has a higher precedence than rollout - very nasty limit.

Add spacing between the buttons and rollouts work fine - as long as you do not move your mouse like a wildman.

Cheers,

Tristan

it’s because of the frames. once the cursor is out of the frame, flash thinks it’s where ever its last x y was. it’s not really a great situation. if you keep everything in flash there’s no problems with the rollout events.

cheers.

Well because FLASH’s Object Model relatively braindead is - I don’t understand the technical reason (because there ain’t one …) for not being able to determine if the film has lost it’s focus - lazy language implementation by Macromedia. Flame!

If I am wrong please Flame me (and tell me the workaround grins)

The trick which worked for me is determining if the mouse hasn’t moved for a given period of time - and altering the timeout duration depending on whether a different button has been rolled over.

It only breaks when the user doesn’t move for an exorbinant amount of time on the border of the film or if the user moves the mouse extremely fast (leaving FLASH with a mouse position of let’s say _xmouse = 100 or so.)

But it is better than leaving the menu “hanging” on the wrong position.

Thanx for your help.

Tristan