View Single Post
  #3  
Old 09-02-2013, 10:23 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
Quote:
Originally Posted by cbk1994 View Post
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.xthis.this.width| && mousey in |this.ythis.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.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote