Quote:
Originally Posted by cbk1994
First of all, please style your code before posting it. Secondly, put that check into a function. Third, leftmousebutton is a boolean indicating whether the left mouse button is pressed or not. It doesn't have anything to do with whether the mouse is over top of your object or not. For that check mousex and mousey. Something like:
PHP Code:
if (leftmousebutton && mousex in |this.x, this.x + this.width| && mousey in |this.y, this.y + this.height|) {
// open
}
You'll need to put that into a timeout. Note that the preferred way to do it would use onMouseDown instead so you don't need a timeout.
|
Thanks for confirming this. I thought it was weird he wasn't checking if the sign itself was clicked, but didn't want to give him bad advice.