PDA

View Full Version : mouse over SWF


emagist
08-30-2003, 08:26 PM
Is there any way to find if the mouse cursor is over a SWF movie?

Adrenaline
08-31-2003, 03:12 PM
Can you give a bit more information...like what do you want to use it for?

Warrior
08-31-2003, 03:18 PM
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse,_root._ymouse,true)) {
_root.output = "Yes!";
} else {
_root.output = "No!";
}
}

Adrenaline
08-31-2003, 03:22 PM
Sweet, I didn't know you could use hittest with the mouse. Learning something new every day. :)

emagist
09-01-2003, 03:53 AM
Adrenaline, i want to put a mouse sensitive banner into an HTML page.
OK, thanks for the answer, Warrior!

I found an answer myself, after digging some docs. I wasn't sure hitTest works, but the next solution really does.

You only have to overlap an entire invisible button over the swf. (AKA a button with the hit area matching the swf area, and the other button states empty). And then you check the mouseOver event handler of the button.