Flushing mouse clicks

Date:    Sun, 26 Feb 1995 11:33:57 -0800
From:    David Miller 
Subject: Lingo: Flushing mouse clicks
I don't know if this does what you want, but I use this object to gobble up mouseclicks. It's not rigorously tested, but it seems to do the job for me.
--Score Script "aFlusher"
 
property psKeyDown, psMouseDown, psMouseUp, psTimeOut, piState
 
on birth me
  set psKeyDown = the keyDownScript
  set psMouseDown = the mouseDownScript
  set psMouseUp = the mouseUpScript
  set psTimeOut = the timeoutScript
  set piState = 0
  return me
end
 
on Flush me
  set psKeyDown = the keyDownScript
  set psMouseDown = the mouseDownScript
  set psMouseUp = the mouseUpScript
  set psTimeOut = the timeoutScript
 
  set the keyDownScript = "dontPassEvent"
  set the mouseDownScript = "dontPassEvent"
  set the mouseUpScript = "dontPassEvent"
  set the timeoutScript = EMPTY
  set piState = 1
end
 
on Restore me
  set the keyDownScript = psKeyDown
  set the mouseDownScript = psMouseDown
  set the mouseUpScript = psMouseUp
  set the timeoutScript = psTimeOut
  set piState = 0
end
 
on EmptyPr me
  set the keyDownScript = ""
  set the mouseDownScript = ""
  set the mouseUpScript = ""
  set the timeoutScript = ""
 
end
 
on RegisterPr me
  set psKeyDown = the keyDownScript
  set psMouseDown = the mouseDownScript
  set psMouseUp = the mouseUpScript
  set psTimeOut = the timeoutScript
end
 
In your startMovie or wherever, after you've set you're primary event handlers:
 
   global gFlusher
       set gFlusher = birth(script "aFlusher")
When you want to gobble mouseclicks, type the following in a frameScript
  
   global gFlusher
      Flush(gFlusher)
To turn mouseclicks back on type:
  
   global gFlusher
        Restore(gFlusher)