home *** CD-ROM | disk | FTP | other *** search
Wrap
property offCast, onCast, rollOverCast, mouseDownCast, currentOverCast, startCast, whichWay, otherSprite, textSprite, pageStatus on beginSprite me set currentOverCast to rollOverCast if whichWay = #up then set the member of sprite the spriteNum of me to member the offCast of me set pageStatus to #first else if whichWay = #down then if the name of the member of sprite textSprite contains "first" then set the member of sprite the spriteNum of me to member the onCast of me set pageStatus to #first else set the member of sprite the spriteNum of me to member the offCast of me set pageStatus to #other end if end if end if end on mouseWithin me case whichWay of #up: if pageStatus = #first then exit end if #down: if pageStatus = #last then exit end if end case if pageStatus = #other then exit end if set the member of sprite the spriteNum of me to currentOverCast end on mouseLeave me case whichWay of #up: if pageStatus = #first then exit end if #down: if pageStatus = #last then exit end if end case if pageStatus = #other then exit end if set the member of sprite the spriteNum of me to onCast end on mouseDown me case whichWay of #up: if pageStatus = #first then exit end if #down: if pageStatus = #last then exit end if end case if pageStatus = #other then exit end if set currentOverCast to the mouseDownCast of me set the member of sprite the spriteNum of me to member the mouseDownCast of me end on mouseUp me if the name of the member of sprite the spriteNum of me = offCast then exit end if set currentOverCast to rollOverCast wait(7) set the member of sprite the spriteNum of me to currentOverCast case whichWay of #up: set the member of sprite textSprite to member (the memberNum of sprite textSprite - 1) of castLib the castLibNum of sprite textSprite if the name of the member of sprite textSprite contains "first" then set pageStatus to #first set the member of sprite the spriteNum of me to offCast end if updateStage() sendSprite(otherSprite, #showSprite, otherSprite) #down: set the member of sprite textSprite to member (the memberNum of sprite textSprite + 1) of castLib the castLibNum of sprite textSprite if the name of the member of sprite textSprite contains "last" then set pageStatus to #last set the member of sprite the spriteNum of me to offCast end if updateStage() sendSprite(otherSprite, #showSprite, otherSprite) end case end on mouseUpOutSide me case whichWay of #up: if pageStatus = #first then exit end if #down: if pageStatus = #last then exit end if end case if pageStatus = #other then exit end if set currentOverCast to the rollOverCast of me end on showSprite me set the member of sprite the spriteNum of me to member the onCast of me end on getPropertyDescriptionList if the currentSpriteNum = 0 then set onCastDefault to 0 set rollOverCastDefault to 0 set mouseDownCastDefault to 0 set textSpriteDefault to 0 else set memberRef to the member of sprite the currentSpriteNum set castLibNum to the castLibNum of memberRef set offCastDefault to the member of sprite the currentSpriteNum set onCastDefault to member (the memberNum of member memberRef + 1) of castLib castLibNum set rollOverCastDefault to member (the memberNum of member memberRef + 2) of castLib castLibNum set mouseDownCastDefault to member (the memberNum of member memberRef + 3) of castLib castLibNum if the name of member the member of sprite the currentSpriteNum contains "up" then set whichWayDefault to #up set otherSpriteDefault to the currentSpriteNum + 1 set textSpriteDefault to the currentSpriteNum - 1 else set whichWayDefault to #down set otherSpriteDefault to the currentSpriteNum - 1 set textSpriteDefault to the currentSpriteNum - 2 end if end if set propertyDescriptionList to [#whichWay: [#comment: "Page up or down?:", #format: #symbol, #range: [#up, #down], #default: whichWayDefault], #offCast: [#comment: "Off cast:", #format: #graphic, #default: offCastDefault], #onCast: [#comment: "On cast:", #format: #graphic, #default: onCastDefault], #rollOverCast: [#comment: "rollOver cast:", #format: #graphic, #default: rollOverCastDefault], #mouseDownCast: [#comment: "mouseDown Cast:", #format: #graphic, #default: mouseDownCastDefault], #otherSprite: [#comment: "Other page sprite:", #format: #integer, #default: otherSpriteDefault], #textSprite: [#comment: "Text sprite:", #format: #integer, #default: textSpriteDefault]] return propertyDescriptionList end on getBehaviorDescription return "This behavior does up and down paging. It requires a setup with a text sprite, a page up sprite and a page down sprite. It works best when they are in the following order:" & RETURN & RETURN & " Sprite n is the text sprite" & RETURN & " Sprite n + 1 is the page up button (use the off version of the button)" & RETURN & " Sprite n + 2 is the page down button (also use the off version)" & RETURN & RETURN & "If it's set up right, you won't need to reset any of the properties. It's also required to set up the text pages in sequence in the cast, and use the word " & QUOTE & "first" & QUOTE & " in the name of the first cast, and the word " & QUOTE & "last" & QUOTE & " in the name of the last cast." end