home *** CD-ROM | disk | FTP | other *** search
/ Better Homes & Gardens: …oking for Today - Chicken / Image.iso / pc / shared.dxr / 01018_checkButton.ls < prev    next >
Encoding:
Text File  |  1995-11-21  |  1.1 KB  |  50 lines

  1. property mySprite, myCast, pressedCast
  2.  
  3. on birth me, spriteNum
  4.   set mySprite to spriteNum
  5.   puppetSprite(mySprite, 1)
  6.   set myCast to the castNum of sprite mySprite
  7.   set pressedCast to myCast + 1
  8.   return me
  9. end
  10.  
  11. on down me
  12.   if the castNum of sprite mySprite = myCast then
  13.     set the castNum of sprite mySprite to pressedCast
  14.     repeat while the mouseDown
  15.       if rollOver(mySprite) then
  16.         set the castNum of sprite mySprite to pressedCast
  17.       else
  18.         set the castNum of sprite mySprite to myCast
  19.       end if
  20.       updateStage()
  21.     end repeat
  22.   else
  23.     set the castNum of sprite mySprite to myCast
  24.     repeat while the mouseDown
  25.       if rollOver(mySprite) then
  26.         set the castNum of sprite mySprite to myCast
  27.       else
  28.         set the castNum of sprite mySprite to pressedCast
  29.       end if
  30.       updateStage()
  31.     end repeat
  32.   end if
  33. end
  34.  
  35. on up me
  36.   if the castNum of sprite mySprite = pressedCast then
  37.     return 1
  38.   else
  39.     return 0
  40.   end if
  41. end
  42.  
  43. on select me
  44.   set the castNum of sprite mySprite to pressedCast
  45. end
  46.  
  47. on unSelect me
  48.   set the castNum of sprite mySprite to myCast
  49. end
  50.