home *** CD-ROM | disk | FTP | other *** search
/ Dé Millennium / MCD.ISO / mmm / probleem.dxr / 00006_MasterRoll.ls < prev    next >
Encoding:
Text File  |  2003-03-23  |  4.0 KB  |  143 lines

  1. property mraBaseName, mraNrOfFrames, mraStartFrame, mraRollType, mraNrOfLoops, mraEnabled, mraVisible, mraCurrentFrame, mraCurrentLoop, mraMouseDownmember, mraMouseDown, mraActive, mraDeactivemember
  2.  
  3. on GetMembernum me
  4.   set name to mraBaseName & string(mraCurrentFrame)
  5.   set number to member the memberNum of member name
  6.   return number
  7. end
  8.  
  9. on MasterRollShow me
  10.   set mraVisible to 1
  11.   set the visible of sprite the currentSpriteNum to mraVisible
  12.   MasterRollDisable(me)
  13. end
  14.  
  15. on MasterRollHide me
  16.   set mraVisible to 0
  17.   set the visible of sprite the currentSpriteNum to mraVisible
  18. end
  19.  
  20. on MasterRollActivate me
  21.   set mraActive to 1
  22. end
  23.  
  24. on MasterRollDeActivate me
  25.   set mraActive to 0
  26.   set the member of sprite the currentSpriteNum to mraDeactivemember
  27. end
  28.  
  29. on MasterRollEnable me
  30.   if mraVisible then
  31.     if mraActive then
  32.       set mraEnabled to 1
  33.       set mraCurrentFrame to mraStartFrame
  34.       set the member of sprite the currentSpriteNum to GetMembernum(me)
  35.     end if
  36.   end if
  37. end
  38.  
  39. on MasterRollDisable me
  40.   if mraVisible then
  41.     if mraActive then
  42.       set mraEnabled to 0
  43.       set mraCurrentFrame to mraStartFrame
  44.       set the member of sprite the currentSpriteNum to GetMembernum(me)
  45.     end if
  46.   end if
  47. end
  48.  
  49. on beginSprite me
  50.   set mraCurrentLoop to 1
  51.   set the visible of sprite the currentSpriteNum to mraVisible
  52. end
  53.  
  54. on mouseEnter me
  55.   if mraVisible then
  56.     if mraActive then
  57.       if not mraMouseDown then
  58.         MasterRollEnable(me)
  59.       else
  60.         set the member of sprite the currentSpriteNum to mraMouseDownmember
  61.       end if
  62.     end if
  63.   end if
  64. end
  65.  
  66. on mouseWithin me
  67.   if mraVisible then
  68.     if mraActive then
  69.       if not mraEnabled and not mraMouseDown then
  70.         MasterRollEnable(me)
  71.       end if
  72.     end if
  73.   end if
  74. end
  75.  
  76. on mouseLeave me
  77.   if mraVisible then
  78.     if mraActive then
  79.       MasterRollDisable(me)
  80.       set mraCurrentLoop to 1
  81.     end if
  82.   end if
  83. end
  84.  
  85. on mouseDown me
  86.   if mraVisible then
  87.     if mraActive then
  88.       set mraMouseDown to 1
  89.       MasterRollDisable(me)
  90.       set the member of sprite the currentSpriteNum to mraMouseDownmember
  91.       pass()
  92.     end if
  93.   end if
  94. end
  95.  
  96. on mouseUp me
  97.   if mraVisible then
  98.     if mraActive then
  99.       set mraMouseDown to 0
  100.       MasterRollEnable(me)
  101.       pass()
  102.     end if
  103.   end if
  104. end
  105.  
  106. on mouseUpOutSide me
  107.   if mraVisible then
  108.     if mraActive then
  109.       set mraMouseDown to 0
  110.       MasterRollEnable(me)
  111.       mouseLeave(me)
  112.     end if
  113.   end if
  114. end
  115.  
  116. on prepareFrame me
  117.   if mraVisible then
  118.     if mraActive then
  119.       if mraEnabled then
  120.         if (mraCurrentLoop <= mraNrOfLoops) or (mraNrOfLoops = 0) then
  121.           set mraCurrentFrame to mraCurrentFrame + 1
  122.           if mraCurrentFrame > mraNrOfFrames then
  123.             if mraRollType = #Animation then
  124.               set mraCurrentFrame to 1
  125.               set mraCurrentLoop to mraCurrentLoop + 1
  126.             else
  127.               set mraCurrentFrame to mraCurrentFrame - 1
  128.             end if
  129.           end if
  130.           set the member of sprite the currentSpriteNum to GetMembernum(me)
  131.         else
  132.           MasterRollDisable(me)
  133.         end if
  134.       end if
  135.     end if
  136.   end if
  137. end
  138.  
  139. on getPropertyDescriptionList
  140.   set p_list to [#mraBaseName: [#comment: "Basename of the memberpics:", #format: #string, #default: "Anim"], #mraNrOfFrames: [#comment: "Number of pics in the animation:", #format: #integer, #default: 2], #mraStartFrame: [#comment: "Startingframe of the animation:", #format: #integer, #default: 1], #mraRollType: [#comment: "Type of the animation:", #format: #symbol, #range: [#Animation, #Highlight], #default: #Animation], #mraNrOfLoops: [#comment: "Times the animation is played:", #format: #integer, #default: 1], #mraEnabled: [#comment: "Initial playing:", #format: #boolean, #default: 0], #mraVisible: [#comment: "Initial visible:", #format: #boolean, #default: 1], #mraActive: [#comment: "Initial active:", #format: #boolean, #default: 1], #mraMouseDownmember: [#comment: "Mousedown picture:", #format: #string, #default: "AnimDown"], #mraDeactivemember: [#comment: "Inactive picture:", #format: #string, #default: "AnimInactive"]]
  141.   return p_list
  142. end
  143.