home *** CD-ROM | disk | FTP | other *** search
/ Comic Book Maker: The Smurfs / COMIC.iso / mac / data_m / dialog / 00006_BasicBtnBhvr.ls < prev    next >
Encoding:
Text File  |  1999-07-07  |  1.9 KB  |  89 lines

  1. property mySprite, myMemb, active, enabled
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on init me, preferredSpriteNum
  8.   if voidp(preferredSpriteNum) then
  9.     set the mySprite of me to the currentSpriteNum
  10.   else
  11.     set the mySprite of me to preferredSpriteNum
  12.   end if
  13.   set the myMemb of me to the memberNum of sprite the mySprite of me
  14.   set the enabled of me to 1
  15. end
  16.  
  17. on mouseDown me
  18.   if not (the enabled of me) then
  19.     exit
  20.   end if
  21.   set the active of me to 1
  22.   set the memberNum of sprite the mySprite of me to the myMemb of me + 1
  23.   if not (the makeSoundDown of me = 0) then
  24.     puppetSound(1, the makeSoundDown of me)
  25.   end if
  26.   updateStage()
  27. end
  28.  
  29. on mouseUp me
  30.   if not (the active of me) then
  31.     exit
  32.   end if
  33.   set the active of me to 0
  34.   set the memberNum of sprite the mySprite of me to the myMemb of me
  35.   if not (the makeSoundUp of me = 0) then
  36.     puppetSound(1, the makeSoundUp of me)
  37.   end if
  38.   doAction(me)
  39. end
  40.  
  41. on update me
  42.   if not (the enabled of me) then
  43.     exit
  44.   end if
  45.   set the memberNum of sprite the mySprite of me to the myMemb of me
  46. end
  47.  
  48. on mouseLeave me
  49.   if not (the active of me) then
  50.     exit
  51.   end if
  52.   set the memberNum of sprite the mySprite of me to the myMemb of me
  53.   updateStage()
  54. end
  55.  
  56. on mouseEnter me
  57.   if not (the active of me) then
  58.     exit
  59.   end if
  60.   set the memberNum of sprite the mySprite of me to the myMemb of me + 1
  61.   updateStage()
  62. end
  63.  
  64. on mouseUpOutSide me
  65.   if not (the active of me) then
  66.     exit
  67.   end if
  68.   set the memberNum of sprite the mySprite of me to the myMemb of me
  69.   set the active of me to 0
  70.   updateStage()
  71. end
  72.  
  73. on enable me
  74.   if the enabled of me then
  75.     exit
  76.   end if
  77.   set the enabled of me to 1
  78.   set the memberNum of sprite the mySprite of me to the myMemb of me
  79. end
  80.  
  81. on disable me
  82.   if not (the enabled of me) then
  83.     exit
  84.   end if
  85.   set the enabled of me to 0
  86.   set the memberNum of sprite the mySprite of me to the myMemb of me + 2
  87.   set the active of me to 0
  88. end
  89.