PDA

View Full Version : catching clicks anywhere except on object


kerel
12-05-2005, 11:47 PM
hi,
I have an object and I want to attach an action to it where you go to another frame when you click anywhere but on the object.
does anyone have any idea how I could achieve this?

thnx! :D

btw: I tried building a 'Hit' area around it, but I don't want a pointer covering everything else.

kerel
12-06-2005, 08:40 AM
someone? :)

Artech
12-06-2005, 09:26 PM
if you were to do something like:


onClipEvent(mouseDown) {
if(!this.hitTest(_root._xmouse,_root._ymouse,true) ) {
gotoAndStop("whenever");
}
}


that should do the trick.

Explanation:
Whenever the mouse button is pressed, it will do a hitTest against whatever MC you put this code in, and if there is a hit (true), the ! (not) symbol flips it to make it false --> Does hit - returns false, no movement :: Doesn't hit - returns true, moves on.

Brian