home *** CD-ROM | disk | FTP | other *** search
- property mraBaseName, mraNrOfFrames, mraStartFrame, mraRollType, mraNrOfLoops, mraEnabled, mraVisible, mraCurrentFrame, mraCurrentLoop, mraMouseDownmember, mraMouseDown, mraActive, mraDeactivemember
-
- on GetMembernum me
- set name to mraBaseName & string(mraCurrentFrame)
- set number to member the memberNum of member name
- return number
- end
-
- on MasterRollShow me
- set mraVisible to 1
- set the visible of sprite the currentSpriteNum to mraVisible
- MasterRollDisable(me)
- end
-
- on MasterRollHide me
- set mraVisible to 0
- set the visible of sprite the currentSpriteNum to mraVisible
- end
-
- on MasterRollActivate me
- set mraActive to 1
- end
-
- on MasterRollDeActivate me
- set mraActive to 0
- set the member of sprite the currentSpriteNum to mraDeactivemember
- end
-
- on MasterRollEnable me
- if mraVisible then
- if mraActive then
- set mraEnabled to 1
- set mraCurrentFrame to mraStartFrame
- set the member of sprite the currentSpriteNum to GetMembernum(me)
- end if
- end if
- end
-
- on MasterRollDisable me
- if mraVisible then
- if mraActive then
- set mraEnabled to 0
- set mraCurrentFrame to mraStartFrame
- set the member of sprite the currentSpriteNum to GetMembernum(me)
- end if
- end if
- end
-
- on beginSprite me
- set mraCurrentLoop to 1
- set the visible of sprite the currentSpriteNum to mraVisible
- end
-
- on mouseEnter me
- if mraVisible then
- if mraActive then
- if not mraMouseDown then
- MasterRollEnable(me)
- else
- set the member of sprite the currentSpriteNum to mraMouseDownmember
- end if
- end if
- end if
- end
-
- on mouseWithin me
- if mraVisible then
- if mraActive then
- if not mraEnabled and not mraMouseDown then
- MasterRollEnable(me)
- end if
- end if
- end if
- end
-
- on mouseLeave me
- if mraVisible then
- if mraActive then
- MasterRollDisable(me)
- set mraCurrentLoop to 1
- end if
- end if
- end
-
- on mouseDown me
- if mraVisible then
- if mraActive then
- set mraMouseDown to 1
- MasterRollDisable(me)
- set the member of sprite the currentSpriteNum to mraMouseDownmember
- pass()
- end if
- end if
- end
-
- on mouseUp me
- if mraVisible then
- if mraActive then
- set mraMouseDown to 0
- MasterRollEnable(me)
- pass()
- end if
- end if
- end
-
- on mouseUpOutSide me
- if mraVisible then
- if mraActive then
- set mraMouseDown to 0
- MasterRollEnable(me)
- mouseLeave(me)
- end if
- end if
- end
-
- on prepareFrame me
- if mraVisible then
- if mraActive then
- if mraEnabled then
- if (mraCurrentLoop <= mraNrOfLoops) or (mraNrOfLoops = 0) then
- set mraCurrentFrame to mraCurrentFrame + 1
- if mraCurrentFrame > mraNrOfFrames then
- if mraRollType = #Animation then
- set mraCurrentFrame to 1
- set mraCurrentLoop to mraCurrentLoop + 1
- else
- set mraCurrentFrame to mraCurrentFrame - 1
- end if
- end if
- set the member of sprite the currentSpriteNum to GetMembernum(me)
- else
- MasterRollDisable(me)
- end if
- end if
- end if
- end if
- end
-
- on getPropertyDescriptionList
- 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"]]
- return p_list
- end
-