Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Track mouse position? 1

Status
Not open for further replies.

oldnewbie

Technical User
Dec 6, 2000
9,142
CA
Hi all!

Is it possible to track the mouse position over an html, and call an alert if the mouse is in fact over (or not!) an embedded object as a Flash movie?

Any thoughts and/or possible scripts?

Thanks!
 
sure...just attach your listener function to
window.onmousemove and/or
window.document.onmousemove and/or
window.document.body.onmousemove

caveat:
NS and IE don't play nice, and have different event object models, so you have to design your code for both.


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Hey Jeff!

Thanks for the fast reply, but could you be a little more specific? I somewhat know my way around Flash, but when it comes to javascript, that's another story!

Maybe I should post an eample of an embedded Flash movie, and you could add an alert call if the mouse leaves the movie area, or it if hovers over it... Would that help?

Thanks again.
 
You could wrap the <OBJECT> tag with a <div> tag... and then set an onmouseover and onmouseout onto the div itself. Try this:

Code:
<div onmouseover="alert('in');" onmouseout="alert('out');"><OBJECT.......</div>

Is this what you are after?

Jeff
 
Ummmmmmmh!

Should I wrap it the table tag rather than just the object tag, as I have done here?


In any case (I did try it just around the object tag), still a problem, even if I took out the mouseover, which I really don't need...
Assuming the mouse isn't over the movie to start with, when you do roll over the movie, you get the alert, which I only really want if I leave the movie area, not when rolling over it.

Thanks for the reply.
Any other ideas?
 

> Should I wrap it the table tag

What table tag? This is the first time you've mentioned a table.

Perhaps you could be a bit more forgiving when we don't know things that you haven't told us anything about ;o)

Dan
 
I posted two htmls... Seems to me, if you're going to try and help me out, that you would at least have a look at the htmls' source code, since that's where the problem lies!
 
I apologise - for some reason, I didn't spot the URLs in your follow-up posts (I did read them, honest!).

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top