home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 2 / boot-disc-1996-10.iso / bootcd.dir / 00297_Script_TVClass < prev    next >
Text File  |  1996-08-09  |  3KB  |  128 lines

  1. property primecast,imagelist,staticcount,spritenum,duration,staticmax
  2. property nextevent,imagecount,staticindex,videomode,videosprite,videolist
  3.  
  4. on new me
  5.   set imagelist=[]
  6.   set videolist=[]
  7.   set staticcount=0
  8.   set duration=3*60
  9.   set staticmax=the frameTempo/3
  10.   set nextevent=0
  11.   set numitems=0
  12.   set videomode=false
  13.   repeat with index=1 to the number of members
  14.     if the casttype of member index=#bitmap then
  15.       set curname=the name of member index
  16.       if offset("tvp_",curname) then
  17.         set primecast=index
  18.         add imagelist,index
  19.       end if
  20.       if offset("tv_",curname) then
  21.         add imagelist,index
  22.         set numitems=numitems+1
  23.         preload member curname
  24.         if numitems mod 4=0 then
  25.           add imagelist,primecast
  26.         end if
  27.       end if
  28.       if offset("static",curname) then
  29.         set staticcount=staticcount+1
  30.         preload member curname
  31.       end if
  32.       if offset("tvm_",curname) then
  33.         add videolist,index
  34.       end if
  35.     end if
  36.   end repeat
  37.   set imagecount=0
  38.   set spritenum=0
  39.   repeat with index=1 to 48
  40.     if the membernum of sprite index>0 then
  41.       if the type of member (the membernum of sprite index)=#digitalVideo then
  42.         set videosprite=index
  43.       end if
  44.     end if
  45.   end repeat
  46.   set the movieRate of sprite videosprite to 0
  47.   set the visible of sprite videosprite to 0
  48.   repeat with index=1 to 48
  49.     if the membernum of sprite index=primecast then
  50.       set spritenum=index
  51.       exit repeat
  52.     end if
  53.   end repeat
  54.   if spritenum=0 then
  55.     alert "Can't find primary image."
  56.     halt
  57.   end if
  58.   puppetsprite spritenum,true
  59.   set obj=getObj("TVClass")
  60.   if objectP(obj) then
  61.     set pos=getpos(the actorlist,obj)
  62.     deleteat the actorlist,pos
  63.   end if
  64.   add the actorlist,me
  65.   set nextevent=the ticks+duration
  66.   return me
  67. end
  68.  
  69. on stepframe me
  70.   if videomode=false then
  71.     if the ticks>nextevent then
  72.       if staticindex=0 then
  73.         puppetsound 0,1
  74.         puppetsound "noiz",1
  75.       end if
  76.       set staticindex=staticindex+1
  77.       set the castnum of sprite spritenum to the number of cast ("Static"&((staticindex mod staticcount)+1))
  78.       updatestage
  79.       if staticindex=staticmax then
  80.         set staticindex=0
  81.         set imagecount=(imagecount mod count(imagelist))+1
  82.         set the membernum of sprite spritenum to getat(imagelist,imagecount)
  83.         set nextevent=the ticks+duration
  84.         set staticindex=0
  85.         updateStage
  86.       end if
  87.     end if
  88.   else
  89.     if the movietime of sprite videosprite=trackStopTime(sprite videosprite, 1) then
  90.       stopvideo me
  91.     end if
  92.   end if
  93. end
  94.  
  95. on dispose me
  96.   set pos=getpos(the actorlist,me)
  97.   deleteat the actorlist,pos
  98.   puppetsprite spritenum,false
  99.   return 0
  100. end
  101.  
  102. on playvideo me
  103.   if videomode then
  104.     stopvideo me
  105.   else
  106.     set videomode=true
  107.     puppetsound 0
  108.     set the visible of sprite videosprite to true
  109.     set the visible of sprite spritenum to false
  110.     set the movierate of sprite videosprite to 1
  111.   end if
  112. end
  113.  
  114. on stopvideo me
  115.   set videomode=false
  116.   set the visible of sprite videosprite to false
  117.   set the movierate of sprite videosprite to 0
  118.   set the movietime of sprite videosprite to trackstarttime(sprite videosprite,1)
  119.   set the pausedAtStart of member (the membernum of sprite videosprite) to true
  120.   set the visible of sprite spritenum to true  
  121. end
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.