home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, myCounter, myIndexNum, totalFrames, hasCursor, whichMovFme, movieOrFrame, playVideo, whichVideo, launchBrowser, whichURL, animDelay, myTimer
- global gMasterObj
-
- on beginSprite me
- set myTimer to the timer
- if (whichMovFme = "<undefined>") or (whichMovFme = EMPTY) then
- set whichMovFme to 0
- end if
- if (whichVideo = "<undefined>") or (whichVideo = EMPTY) then
- set whichVideo to 0
- end if
- if (whichURL = "<undefined>") or (whichURL = EMPTY) then
- set whichURL to 0
- end if
- set myIndexNum to the memberNum of sprite spriteNum
- set myCounter to 0
- end
-
- on exitFrame me
- if rollOver(spriteNum) then
- displayCursor(me)
- if the timer > (myTimer + animDelay) then
- set myTimer to the timer
- set myCounter to myCounter + 1
- if myCounter > (totalFrames - 1) then
- set myCounter to 0
- end if
- display(me)
- end if
- else
- if myCounter > 0 then
- if the timer > (myTimer + animDelay) then
- set myTimer to the timer
- set myCounter to myCounter + 1
- if myCounter > (totalFrames - 1) then
- set myCounter to 0
- end if
- display(me)
- end if
- end if
- end if
- end
-
- on display me
- set the memberNum of sprite spriteNum to myIndexNum + myCounter
- end
-
- on displayCursor me
- if hasCursor and ((whichMovFme <> 0) or (playVideo and (whichVideo <> 0)) or (launchBrowser and (whichURL <> 0))) then
- if the mouseDown then
- set the cursor of sprite spriteNum to [2, 2]
- else
- set the cursor of sprite spriteNum to [1, 2]
- end if
- end if
- end
-
- on mouseUp me
- if playVideo and (whichVideo <> 0) then
- if objectp(gMasterObj) then
- playVideo(gMasterObj, whichVideo)
- end if
- else
- if launchBrowser and (whichURL <> 0) then
- if objectp(gMasterObj) then
- openNetPage(gMasterObj, whichURL)
- end if
- else
- if whichMovFme <> 0 then
- if movieOrFrame = #movie then
- if objectp(gMasterObj) then
- autoGoMovie(gMasterObj, whichMovFme, 1, 1)
- end if
- else
- go(whichMovFme)
- end if
- end if
- end if
- end if
- end
-
- on getPropertyDescriptionList
- set descriptionList to [:]
- addProp(descriptionList, #totalFrames, [#default: 10, #format: #integer, #comment: "Total of target anim:"])
- addProp(descriptionList, #animDelay, [#default: 0, #format: #integer, #comment: "Set frame delay [ticks]:"])
- addProp(descriptionList, #hasCursor, [#default: 1, #format: #boolean, #comment: "Has cursor on rollover:"])
- addProp(descriptionList, #movieOrFrame, [#default: "Movie", #format: #string, #comment: "Which", #range: [#movie, #frame]])
- addProp(descriptionList, #whichMovFme, [#default: "<undefined>", #format: #string, #comment: "to go to:"])
- addProp(descriptionList, #playVideo, [#default: 0, #format: #boolean, #comment: "Plays video:"])
- addProp(descriptionList, #whichVideo, [#default: "<undefined>", #format: #string, #comment: "Which video file:"])
- addProp(descriptionList, #launchBrowser, [#default: 0, #format: #boolean, #comment: "Launches Browser:"])
- addProp(descriptionList, #whichURL, [#default: "<undefined>", #format: #string, #comment: "Which URL:"])
- return descriptionList
- end
-