home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / VIDEO / V102401.dxr / 00026_DirectMedia Xtra Controller Button.ls < prev    next >
Encoding:
Text File  |  2000-10-03  |  3.6 KB  |  63 lines

  1. property videoSprite, VideoCommand, standardImage, alternateImage, clickedImage, param1, param2
  2.  
  3. on DoControl me
  4.   case the VideoCommand of me of
  5.     #play:
  6.       videoplay(sprite(the videoSprite of me))
  7.     #pause:
  8.       videopause(sprite(the videoSprite of me))
  9.     #Rewind:
  10.       videoseek(sprite(the videoSprite of me), the segmentstart of sprite(the videoSprite of me))
  11.     #StepForward:
  12.       videopause(sprite(the videoSprite of me))
  13.       videoseek(sprite(the videoSprite of me), the currentTime of sprite(the videoSprite of me) + 30)
  14.     #StepBackward:
  15.       videopause(sprite(the videoSprite of me))
  16.       videoseek(sprite(the videoSprite of me), the currentTime of sprite(the videoSprite of me) - 30)
  17.     #Seek:
  18.       videoseek(sprite(the videoSprite of me), the param1 of me)
  19.     #playsegment:
  20.       videoplaysegment(sprite(the videoSprite of me), the param1 of me, the param2 of me)
  21.   end case
  22. end
  23.  
  24. on mouseUp me
  25.   set the member of sprite the spriteNum of me to the standardImage of me
  26.   DoControl(me)
  27.   cursor(-1)
  28. end
  29.  
  30. on mouseDown me
  31.   set the member of sprite the spriteNum of me to the clickedImage of me
  32. end
  33.  
  34. on mouseEnter me
  35.   set the member of sprite the spriteNum of me to the alternateImage of me
  36.   cursor(280)
  37. end
  38.  
  39. on mouseLeave me
  40.   set the member of sprite the spriteNum of me to the standardImage of me
  41.   cursor(-1)
  42. end
  43.  
  44. on beginSprite me
  45.   set the standardImage of me to the member of sprite the spriteNum of me
  46. end
  47.  
  48. on getPropertyDescriptionList
  49.   if the currentSpriteNum = 0 then
  50.     set memdefault to 0
  51.   else
  52.     set memref to the member of sprite the currentSpriteNum
  53.     set memdefault to member (the memberNum of member memref + 1)
  54.     set memdefault2 to member (the memberNum of member memref + 2)
  55.   end if
  56.   set p_list to [#VideoCommand: [#comment: "Action:", #format: #symbol, #range: [#play, #pause, #Rewind, #StepBackward, #StepForward, #Seek, #playsegment], #default: #play], #param1: [#comment: "First Parameter (Use with seek or playsegment):", #format: #long, #default: 0], #param2: [#comment: "Second Parameter (Use with playsegment):", #format: #long, #default: 0], #videoSprite: [#comment: "DirectMedia Sprite Channel:", #format: #integer, #default: 1], #alternateImage: [#comment: "Rollover Button Cast Member:", #format: #graphic, #default: memdefault], #clickedImage: [#comment: "Clicked Button Cast Member:", #format: #graphic, #default: memdefault2]]
  57.   return p_list
  58. end
  59.  
  60. on getBehaviorDescription
  61.   return "Used to create Play, Pause, StepForward, StepBackward, Rewind, Seek and PlaySegment control buttons for a DirectMedia Xtra video sprite. You can also attach rollover and alternate images for the clicked buttons" & RETURN & "PARAMETERS:" & RETURN & "Action - Choose the action to perform on mouseUP ( Play, Pause, Rewind, StepBackward, StepForward, Seek, PlaySegment )." & RETURN & "First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)" & RETURN & "Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)" & RETURN & "DirectMedia Sprite Channel - Enter the number of sprite channel of the DirectMedia Xtra video that is being controlled." & RETURN & "Rollover Button: the castmember that will be used as the rollover image of the button. Default is the castmember located just after the button castmember" & RETURN & "Clicked Button: the castmember that will be used as the clicked image of the button. Default is the castmember located just after the rollover castmember"
  62. end
  63.