home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / casestdy / ch14_csa / d4vers / csaa.dir / 00001.ls next >
Encoding:
Text File  |  1996-06-17  |  2.9 KB  |  102 lines

  1. global gTargetList, gBaseURL, gHistory, gEyeBallChan, gSegStart, gNextRandTime, gButtonInks, gRearViewChan, gCarByeSnd, gBigMapChan, gAlertChan, gVioConChan, gTerrainChan, oldMousePoint, oldAngle, gRealPageList
  2.  
  3. on startMovie
  4.   setConstants()
  5.   initSprites()
  6. end
  7.  
  8. on setConstants
  9.   set gTargetList to ["getaways.html", "about.html", "whatsnew.html", "travel.html", "join.html", "insurance.html", "education.html", "auto_services.html", "csaakids.html"]
  10.   set gRealPageList to ["/getaways/", "/about/", "/whatsnew/", "/travel/", "/join/", "/insurance/", "/education/", "/auto_services/", "/csaakids/"]
  11.   if not gBaseURL then
  12.     set gBaseURL to "http://www.dxm.com/csaaTour/"
  13.   end if
  14.   if not gHistory then
  15.     set gHistory to []
  16.   end if
  17.   set gButtonInks to [6, 33]
  18.   set gRearViewChan to 16
  19.   set gTerrainChan to [2, 3, 5, 6, 7, 11, 12]
  20.   set gAlertChan to [46, 47, 48]
  21.   set gCarByeSnd to "carBy"
  22.   set gBigMapChan to 24
  23.   set gEyeBallChan to 20
  24.   set gVioConChan to 45
  25.   set gSegStart to the ticks
  26.   set gNextRandTime to 600 + random(800)
  27.   set the randomSeed to the ticks
  28. end
  29.  
  30. on initSprites
  31.   allSprites(-1, 1, 1, gBigMapChan - 1)
  32.   allSprites(0, 0, gBigMapChan, 42)
  33.   puppetSprite(gEyeBallChan, 1)
  34.   puppetSprite(gEyeBallChan + 1, 1)
  35.   set the visible of sprite gRearViewChan to 0
  36.   set the visible of sprite 23 to 1
  37.   preLoad(label("tween"), label("tween") + 4)
  38.   preLoadCast(the number of cast "weekgtaway-viol", the number of cast "kdsclb-viol")
  39.   allSprites(-1, 0, getAt(gAlertChan, 1), getLast(gAlertChan))
  40.   set oldMousePoint to [:]
  41.   set oldAngle to [:]
  42. end
  43.  
  44. on conformCastNames
  45.   set vStart to the number of cast "viol"
  46.   set bStart to the number of cast "bill"
  47.   set oldDelim to the itemDelimiter
  48.   set the itemDelimiter to "-"
  49.   set castIndex to 0
  50.   if (bStart > 0) and (vStart > 0) then
  51.     repeat with i in gTargetList
  52.       set shortName to item 1 of i
  53.       set the name of cast (vStart + castIndex) to shortName & "-viol"
  54.       set the name of cast (bStart + castIndex) to shortName & "-bill"
  55.       set castIndex to castIndex + 1
  56.     end repeat
  57.   end if
  58.   set the itemDelimiter to oldDelim
  59. end
  60.  
  61. on setTargetPage thePageNum
  62.   global gTindex, gNextFrame
  63.   if integerp(thePageNum) then
  64.     set gTindex to thePageNum
  65.   else
  66.     if not gNextFrame or (gNextFrame = getLast(gTargetList)) then
  67.       set thePageNum to 1
  68.     else
  69.       set thePageNum to getPos(gTargetList, gNextFrame) + 1
  70.     end if
  71.   end if
  72.   set gNextFrame to getAt(gTargetList, thePageNum)
  73.   puppetSprite(gVioConChan, 1)
  74.   go(label("tween"))
  75. end
  76.  
  77. on idle
  78.   global cgiFlag, gCGIResult
  79.   if cgiFlag = 1 then
  80.     set gCGIResult to checkCGI()
  81.   end if
  82.   if not (the visible of sprite gBigMapChan) then
  83.     followEyes()
  84.   end if
  85. end
  86.  
  87. on enterFrame
  88.   global gSegStart, gNextRandTime
  89.   if the visible of sprite gBigMapChan = 1 then
  90.     doMap("animate")
  91.     checkMapRolz()
  92.   else
  93.     if the ticks > (gSegStart + gNextRandTime) then
  94.       animateRearView()
  95.     end if
  96.   end if
  97. end
  98.  
  99. on stopMovie
  100.   allSprites(0, 1)
  101. end
  102.