home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / ch07_au / cmddemos / simplayr.dir / 00021.ls < prev    next >
Encoding:
Text File  |  1996-12-06  |  1.6 KB  |  76 lines

  1. global gSWAflag, gTimeBarSprite, gSWAFile, gSWAStatus
  2.  
  3. on startMovie
  4.   global gButtonFamily
  5.   set gButtonFamily to ["result", "script"]
  6.   set gSWAFile to the text of field "argument"
  7.   set gTimeBarSprite to 14
  8.   soundConfig("SWAHolder", gSWAFile)
  9. end
  10.  
  11. on idle
  12.   if gSWAflag = 1 then
  13.     checkSWA("SWAholder")
  14.   end if
  15. end
  16.  
  17. on stopMovie
  18. end
  19.  
  20. on soundConfig membername, SWAfile
  21.   if not (the movieName contains ".dcr") then
  22.     exit
  23.   end if
  24.   set the URL of member membername to SWAfile
  25.   set the preLoadTime of member membername to 5
  26.   PreLoadBuffer(member membername)
  27.   set gSWAflag to 1
  28. end
  29.  
  30. on checkSWA membername
  31.   set gSWAStatus to the state of member membername
  32.   if gSWAStatus = 2 then
  33.   else
  34.     if gSWAStatus = 3 then
  35.       updateTimeBar(the percentPlayed of member membername)
  36.     else
  37.       if gSWAStatus = 5 then
  38.         updateTimeBar(100)
  39.         set gSWAflag to 0
  40.       else
  41.         if gSWAStatus = 9 then
  42.           set errorCode to GetError(member membername)
  43.           set errorString to GetErrorString(member membername)
  44.           debug(errorCode, errorString)
  45.           set gSWAflag to 0
  46.         end if
  47.       end if
  48.     end if
  49.   end if
  50. end
  51.  
  52. on buttonMan
  53.   global gButtonFamily
  54.   set cName to the name of member the memberNum of sprite the clickOn
  55.   put cName
  56.   repeat with i in gButtonFamily
  57.     if i = cName then
  58.       go(label(i))
  59.       exit
  60.     end if
  61.   end repeat
  62.   updateStage()
  63. end
  64.  
  65. on updateTimeBar value
  66.   if not (the puppet of sprite gTimeBarSprite) then
  67.     puppetSprite(gTimeBarSprite, 1)
  68.   end if
  69.   set the width of sprite gTimeBarSprite to value
  70.   updateStage()
  71. end
  72.  
  73. on debug message
  74.   put message into field "results"
  75. end
  76.