[comp.sys.mac.hypercard] HYPER-HACKERS Digest Vol. 1 #14

chuq@plaid.Sun.COM (Chuq Von Rospach) (02/06/88)

                   HYPER-HACKERS Digest Vol. 1 #14
                           February 5, 1988

                              Subjects:

              Subject:   Buttons that can be held down\

----------------------------------------------------------------------
From: PUGH@NMFECC.ARPA
Subject:   Buttons that can be held down\
Date: 	  Mon, 1 Feb 88 13:59:32 PST

Here is a nifty little script that makes an arrow button go to the next card. 

It's beauty is that if you hold the button down it continues to be active 
without waiting for the mouseUp.  The trick was to avoid the mouseUp once the 
mouseStillDown had run since at that point the user will want to remain where 
he is instead of continuing to the next card.  The reason for the mouseUp 
handler is to account for mouse clicks that are shorter than the time alloted 
to the mouseStillDown event.  Check it out.  I think these buttons feel real 
nice.

Jon

on mouseStillDown
  global beenHere
  put true into beenHere
  doIt
end mouseStillDown

on mouseUp
  global beenHere
  if beenHere is empty then put false into beenHere
  if not beenHere then
    doIt
  end if
  put false into beenHere
end mouseUp

on doIt
  visual effect dissolve	-- put your own function in here
  go to next card
end doIt

***********************************
End of HYPER-HACKERS Digest