home *** CD-ROM | disk | FTP | other *** search
/ Blender Volume 3 #4 / Blender_3_4.iso / BLENDER / FILES / Shared.Cst / 00060.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  2.8 KB  |  111 lines

  1. --VIDEO CONTROLS
  2.  
  3. on initVid
  4.   --  35 = OPTIONAL - still of first video frame 
  5.   --  36 = controller bar
  6.   --  37 = play/pause toggle
  7.   --  NOTE: the regPoint of the play/pause cast members is centered!
  8.   --  38 = video on/off toggle
  9.   --  39 = line cast member position and width of video controls
  10.   --  40 = video 
  11.   
  12.   repeat with i = 36 to 38
  13.     set the visible of sprite i to 1
  14.     puppetSprite i, 1
  15.   end repeat
  16.   
  17.   set x = the left of sprite 39
  18.   set w = the width of sprite 39
  19.   set z = the bottom of sprite 39
  20.   
  21.   set n = 0
  22.   if the paramCount >= 1 then set n = param(1)
  23.   if the paramCount  = 2 then set x = x + param(2)
  24.   
  25.   set the locH of sprite 37 to (x + 18)
  26.   set the locV of sprite 37 to (z + n + 18)
  27.   
  28.   set the locH of sprite 38 to (x + w - 35)
  29.   set the locV of sprite 38 to (z + n)
  30.   
  31.   set the width of sprite 36 to (w - 75)
  32.   set the locH of sprite 36 to x + 18
  33.   set the locV of sprite 36 to z + n + 14
  34. end
  35.  
  36. --**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--
  37.  
  38. on moveThumbNail
  39.   global VID
  40.   
  41.   set y = the left of sprite 36
  42.   set w = the width of sprite 36
  43.   set the locH of sprite 37 to ┬¼
  44.      y + (1.00 * w / VID) * the movieTime of sprite 40
  45. end moveThumbNail
  46.  
  47. --**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--
  48.  
  49. on controlVideo sp, h, flag
  50.   global VID
  51.   
  52.   -- sp   : the clickOn
  53.   -- h    : the mouseH
  54.   -- flag : play button  -> 1
  55.   --        pause button -> 0
  56.   
  57.   set pos = the locH of sprite sp
  58.   set a = (the left of sprite 36) * 1.00
  59.   set w = the width of sprite 36
  60.   
  61.   set offx = h - pos  -- offset from regPoint
  62.   
  63.   if the stillDown then 
  64.     set the movieRate of sprite 40 to 0
  65.     repeat while the stillDown
  66.       set x = constrainH(36,the mouseH - offx)
  67.       set the locH of sprite sp to x
  68.       set t = integer((x - a) / w * VID)
  69.       set the movieTime of sprite 40 to min(t, VID - 1)
  70.       updateStage
  71.     end repeat
  72.   end if
  73.   
  74.   if the locH of sprite sp = pos then
  75.     set the movieRate of sprite 40 to not(flag)
  76.     set the memberNum of sprite sp to (49 + flag)
  77.   else
  78.     set the movieRate of sprite 40 to flag
  79.   end if
  80.   updateStage
  81. end controlVideo
  82.  
  83. --**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--
  84.  
  85. on flashVideo
  86.   global k, ROLLNUMBER
  87.   
  88.   set sp = 38
  89.   set myCast = 27 
  90.   --  set myCast = the number of member "VID21" of cast "Shared.Cst"
  91.   if rollover(sp) then
  92.     --VIDEO OFF
  93.     set ROLLNUMBER = 9
  94.     set the memberNum of sprite sp to (myCast + k)
  95.   else
  96.     set the memberNum of sprite sp to myCast
  97.   end if
  98. end flashVideo
  99.  
  100. --**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--**--
  101.  
  102. on disposeVid
  103.   repeat with i = 35 to 40
  104.     puppetSprite i, 0
  105.     set the visible of sprite i to 0
  106.   end repeat
  107.   repeat with i = 35 to 40
  108.     set the visible of sprite i to 1
  109.   end repeat
  110. end disposeVid
  111.