On Sat, 6 Nov 1999, Eva Isotalo wrote:

> Scott wrote:
> 
> >Oooh!  This is Very Bad!  
> 
> Okey, so I've been bad again ....  ;o). Well, I've fixed it now.
> Thank you Scott! The problem went away. 
> 
> The even "badder" thing was that I already was given the advice of
> using the mouseMove coordinates. But I had some problems at one
> place making it all work so I skipped that one. That's what you get
> for not understanding what you are doing.

A problem we all share.  But it's amazing how far we get even under
these situations, and what truly separates human intelligence from
machine intelligence (which usually collapses in a heap if anything at
all is missing).  Still, more examples would probably have saved you a
lot of time...

> >Also, as a general rule, you should also never use "the mouse" or "the
> >mouseLoc" in a mouse-related message handler. 
> 
> I understand this...
> 
> >Instead, set a local
> >variable or property on the object to indicate the current state of
> >the mouse button, and save off the parameters of the mouseMove message
> >if you might need them later.  
> 
> ... but not this.

local curcoords, curstate

on mouseMove x,y
  put x,y into curcoords
end mouseMove

on mouseDown
  put "down" into curstate
end mouseDown

on mouseUp
  put "up" into curstate
end mouseUp

on rawKeyDown
  put "The mouse is at position" && curcoords && "and is" && curstate
end rawKeyDown

The architecture would be the same with properties, except that
"curcoords" and "curstate" would custom properties on some object.
  Regards,
    Scott

> Regards,
> Eva
> 
> 
> >  Regards,
> >    Scott
> >
> 
> 
> 

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

Reply via email to