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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to prevent clicking on hidden buttons

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm making a fake computer interface with draggable windows (by the header bar only). Everything is working fine except that you can click right through my windows to buttons behind them.

I've tried adding an invisible button on top of the window panes (content area): it worked but now I have a misleading little hand cursor that'll make them think they can click on something.

Any suggestions?
 
Try using movieClips to receive mouse input instead of buttons (a movieClip with onClipEvent(mouseUp) instead of a button with on(release) will do the same job). This way only the TOP movieClip will respond, as long as you set the "hit" area of the movieClip/button using this code:
Code:
onClipEvent(mouseUp){
    if(this.hitTest(_root._xmouse, _root._ymouse, true){
        //put your actions here
    }
}
This code will execute the actions you insert if the mouse pointer is released anywhere inside the movieClip it is attached to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top