home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 July / DPPCPRO0799.ISO / Ents / Files / menu.dxr / 00117_loopBehaviour.ls < prev    next >
Encoding:
Text File  |  1999-04-21  |  3.1 KB  |  95 lines

  1. property spriteNum, myCounter, myIndexNum, totalFrames, hasCursor, whichMovFme, movieOrFrame, playVideo, whichVideo, launchBrowser, whichURL, animDelay, myTimer
  2. global gMasterObj
  3.  
  4. on beginSprite me
  5.   set myTimer to the timer
  6.   if (whichMovFme = "<undefined>") or (whichMovFme = EMPTY) then
  7.     set whichMovFme to 0
  8.   end if
  9.   if (whichVideo = "<undefined>") or (whichVideo = EMPTY) then
  10.     set whichVideo to 0
  11.   end if
  12.   if (whichURL = "<undefined>") or (whichURL = EMPTY) then
  13.     set whichURL to 0
  14.   end if
  15.   set myIndexNum to the memberNum of sprite spriteNum
  16.   set myCounter to 0
  17. end
  18.  
  19. on exitFrame me
  20.   if rollOver(spriteNum) then
  21.     displayCursor(me)
  22.     if the timer > (myTimer + animDelay) then
  23.       set myTimer to the timer
  24.       set myCounter to myCounter + 1
  25.       if myCounter > (totalFrames - 1) then
  26.         set myCounter to 0
  27.       end if
  28.       display(me)
  29.     end if
  30.   else
  31.     if myCounter > 0 then
  32.       if the timer > (myTimer + animDelay) then
  33.         set myTimer to the timer
  34.         set myCounter to myCounter + 1
  35.         if myCounter > (totalFrames - 1) then
  36.           set myCounter to 0
  37.         end if
  38.         display(me)
  39.       end if
  40.     end if
  41.   end if
  42. end
  43.  
  44. on display me
  45.   set the memberNum of sprite spriteNum to myIndexNum + myCounter
  46. end
  47.  
  48. on displayCursor me
  49.   if hasCursor and ((whichMovFme <> 0) or (playVideo and (whichVideo <> 0)) or (launchBrowser and (whichURL <> 0))) then
  50.     if the mouseDown then
  51.       set the cursor of sprite spriteNum to [2, 2]
  52.     else
  53.       set the cursor of sprite spriteNum to [1, 2]
  54.     end if
  55.   end if
  56. end
  57.  
  58. on mouseUp me
  59.   if playVideo and (whichVideo <> 0) then
  60.     if objectp(gMasterObj) then
  61.       playVideo(gMasterObj, whichVideo)
  62.     end if
  63.   else
  64.     if launchBrowser and (whichURL <> 0) then
  65.       if objectp(gMasterObj) then
  66.         openNetPage(gMasterObj, whichURL)
  67.       end if
  68.     else
  69.       if whichMovFme <> 0 then
  70.         if movieOrFrame = #movie then
  71.           if objectp(gMasterObj) then
  72.             autoGoMovie(gMasterObj, whichMovFme, 1, 1)
  73.           end if
  74.         else
  75.           go(whichMovFme)
  76.         end if
  77.       end if
  78.     end if
  79.   end if
  80. end
  81.  
  82. on getPropertyDescriptionList
  83.   set descriptionList to [:]
  84.   addProp(descriptionList, #totalFrames, [#default: 10, #format: #integer, #comment: "Total of target anim:"])
  85.   addProp(descriptionList, #animDelay, [#default: 0, #format: #integer, #comment: "Set frame delay [ticks]:"])
  86.   addProp(descriptionList, #hasCursor, [#default: 1, #format: #boolean, #comment: "Has cursor on rollover:"])
  87.   addProp(descriptionList, #movieOrFrame, [#default: "Movie", #format: #string, #comment: "Which", #range: [#movie, #frame]])
  88.   addProp(descriptionList, #whichMovFme, [#default: "<undefined>", #format: #string, #comment: "to go to:"])
  89.   addProp(descriptionList, #playVideo, [#default: 0, #format: #boolean, #comment: "Plays video:"])
  90.   addProp(descriptionList, #whichVideo, [#default: "<undefined>", #format: #string, #comment: "Which video file:"])
  91.   addProp(descriptionList, #launchBrowser, [#default: 0, #format: #boolean, #comment: "Launches Browser:"])
  92.   addProp(descriptionList, #whichURL, [#default: "<undefined>", #format: #string, #comment: "Which URL:"])
  93.   return descriptionList
  94. end
  95.