home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 7 B / CHIP_HITWARE_7B.iso / Edukacja / Guitar Tuner / Wintun16.dxr / 00020_pressButton.ls < prev    next >
Encoding:
Text File  |  1997-04-24  |  864 b   |  34 lines

  1. on pressButton
  2.   set chButton to the clickOn
  3.   set castNumButtonUp to the castNum of sprite chButton
  4.   set butUpName to the name of cast castNumButtonUp
  5.   set nWordsInName to the number of words in butUpName
  6.   if nWordsInName > 1 then
  7.     if word 2 of butUpName = "Grey" then
  8.       return 0
  9.     end if
  10.   end if
  11.   set castNumButtonDown to castNumButtonUp + 1
  12.   puppetSound("3")
  13.   set downFlag to 1
  14.   repeat while downFlag
  15.     if rollOver(chButton) then
  16.       set the castNum of sprite chButton to castNumButtonDown
  17.     else
  18.       set the castNum of sprite chButton to castNumButtonUp
  19.     end if
  20.     updateStage()
  21.     set downFlag to the stillDown
  22.   end repeat
  23.   set the castNum of sprite chButton to castNumButtonUp
  24.   repeat while soundBusy(1)
  25.   end repeat
  26.   puppetSound(0)
  27.   updateStage()
  28.   if rollOver(chButton) then
  29.     return 1
  30.   else
  31.     return 0
  32.   end if
  33. end
  34.