home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 5 / boot-disc-1997-01.iso / media / utility.cst / 00018_Script_BannerClass < prev    next >
Text File  |  1996-11-05  |  1KB  |  50 lines

  1. property charindex,sourcestr,targetstr,targetfield,ancestor,numchars,mode
  2.  
  3. on new me,mysource,mytargetfield,mymode,mynumchars
  4.   set ancestor=new(script "GenericClass")
  5.   set sourcestr=mysource
  6.   if voidP(mymode) then
  7.     set mode=#center
  8.   else
  9.     set mode=mymode
  10.   end if
  11.   set numchars=mynumchars
  12.   set targetfield=mytargetfield
  13.   set targetstr=""
  14.   set startindex=0
  15.   set charindex=0
  16.   clearactorlist me,"BannerClass",#targetfield
  17.   add the actorlist,me
  18.   return me
  19. end
  20.  
  21. on stepframe me
  22.   case mode of
  23.     #center:
  24.       set charindex=charindex+1
  25.       if charindex>length(sourcestr) then
  26.         set charindex=0
  27.         set targetstr=""
  28.       else
  29.         set targetstr=targetstr&(char charindex of sourcestr)
  30.         set the text of member targetfield to targetstr
  31.       end if
  32.     #scroll:
  33.       set charindex=(charindex mod length(sourcestr))+1
  34.       if length(targetstr)<numchars then
  35.         set targetstr=targetstr&(char charindex of sourcestr)
  36.       else
  37.         delete char 1 of targetstr
  38.         set targetstr=targetstr&(char charindex of sourcestr)
  39.       end if
  40.       set the text of member targetfield to targetstr
  41.   end case
  42. end
  43.  
  44. on dispose me
  45.   set the text of member targetfield to  " "
  46.   clearactorlist me,"BannerClass",#targetfield
  47.   return 0
  48. end
  49.  
  50.