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

  1. -- the following script is in the Play/Pause 
  2. -- button:
  3.  
  4. on mouseUp
  5.   global gSWAStatus,gSWAFlag,gSWAFile
  6.   if gSWAFile <> the text of field¬¨
  7.  "argument" then
  8.    stop (member "SWAHolder")
  9.    set gSWAFile = the text of field "argument" 
  10.    set the URL of member "SWAHolder" = gSWAFile
  11.   end if
  12.   if (gSWAstatus <= 2) or (gSWAstatus = 4) then
  13.    play (member "SWAHolder")
  14.   else if gSWAstatus = 3 then
  15.    pause (member "SWAHolder")
  16.   end if
  17. end
  18.  
  19. -- the next one is in the Stop button:
  20.  
  21. on mouseUp
  22.   stop (member "SWAHolder")
  23. end
  24.  
  25. -- next are some important movie scripts
  26. -- the globals are declared at the top of the 
  27. -- movie script so they are not repeated 
  28. -- in the handlers.
  29.  
  30. on idle
  31.   if gSWAflag = 1 then checkSWA "SWAholder"
  32. end
  33.  
  34. on checkSWA membername
  35.   set gSWAstatus = the state of member ¬¨ 
  36. membername
  37.   if gSWAstatus = 2 then
  38.     -- the SWA is ready to play
  39.   else if gSWAstatus = 3 then
  40.     updateTimeBar (the percentPlayed of ¬¨
  41.  member membername) 
  42.   else if gSWAstatus = 5 then
  43.     updateTimeBar 100
  44.     set gSWAflag = 0
  45.   else if gSWAstatus = 9 then
  46.     set errorCode = getError(member membername)
  47.     set errorString = ¬¨
  48. getErrorString(member membername)
  49.     debug errorCode,errorString
  50.     set gSWAflag = 0
  51.   end if
  52. end