home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / shared.cst / 00020_Script_rQTNavMgr < prev    next >
Text File  |  1997-07-24  |  32KB  |  952 lines

  1. --o:         QT Nav Mgr
  2.  
  3. -- gQTNavMgr
  4.  
  5. global gQTNavMgr, gEventMgrRD, gActorListMgrObj, gInterfaceMgrObj, gUtilityObj, gSndPath
  6.  
  7. property pStartDragV, pStartDragH
  8. property pMaxImageV, pMaxImageH, pCurrImageV, pCurrImageH
  9. property pPixToFrames, pDragImageV, pDragImageH, pQTSprite, pQTFramesPerImage
  10. property pMyStatus, pImageNumber, pNavMovieCast
  11. property pWhichNavMovie
  12. property pHandMaskPath, pReelMaskPath, pShutMaskPath, pViewMaskPath
  13. property pPHSweetSpotList, pAESweetSpotList, pSESweetSpotList, pPASweetSpotList
  14. property pTargetVertical, pTargetHorizontal, pVertStep, pHorStep
  15. property pWhichSpotNum, pPhonoAnimFlag, pAEFlyRightAnim
  16. property pStylusZoom1, pStylusZoom2
  17. property pSndPath, pQTPath, pSndChannel, pKGAnimFlag, pSEAnimFlag
  18. property pFramesPerLineH, pHandleRectList, pStylusRectList, pReelRectList, pShutterRectList, pViewRectList
  19.  
  20. property pQTRect, pBkgdSprite
  21. property pHandCursor, pZoomInCursor, pZoomOutCursor, 
  22. property pHandleRect, pStylusRect, pReelRect, pShutterRect, pViewRect
  23. property pOrderedCursorList, pOrderedHotSpotRectList, pOrderedHotSpotList, pHotSpotStatus
  24. property pLastFrameNum
  25. property pAEBodyRectList, pAEWingRectList, pAEBodyRect, pAEWingRect, pAEAnimFlag
  26. property pRevealCursor, pMouthRect, pHayRect, pEarRect, pPAAnimFlag
  27. property pMouthRectList, pHayRectList, pEarRectList, pCylRectList, pCondRectList, pArmRectList
  28. property pCylRect, pCondRect, pArmRect
  29. property pPAPlayMovieLocList, pCursorReturnList
  30. property pLabelTextCast, pDescriptionTextCast, pInstructionTextCast, pBaseText
  31. property pOldMouseV, pOldMouseH, pCurrSweetSpotList, pRotateFrame, pCurrExpText
  32. property pRevealList, pZoomList
  33. property pRotateDirectionList,pPGSnd,pPGSndList, pKGSweetSpotList
  34. property pQTplaySprite, pBaseQTlocV
  35. property pLoadFoil, pActiveToolMenu
  36. property pAcitiveAmbSnd, pSecondaryText, pTinFoilLoadText
  37.  
  38. global gActiveFunctionObj, gInventorIndexNum
  39. global gEdisonFilmed, gMouseDownExp, gactiveambsnd
  40. --
  41. on mInit me, myCastList, QTDirectorypath, SndDirectoryPath
  42.   
  43.   set pQTSprite = 14
  44.   set pQTplaySprite = 23
  45.   set pBkgdSprite = 6
  46.   
  47.   set pSndChannel = 2
  48.   set pMaxImageV = 25
  49.   set pMaxImageH = 36
  50.   set pPixToFrames = 10
  51.   set pQTFramesPerImage = 60
  52.   
  53.   set pPHSweetSpotList = [433:"13,19",451:"13,1",865:"25,1",460:"13,28",442:"13,10"]
  54.   set pKGSweetSpotList = [442:"13,10",460:"13,28",865:"25,1",433:"13,1",451:"13,19"]
  55.   set pAESweetSpotList = [0:"1,1",441:"13,10",864:"25,1",432:"13,1",450:"13,19"]
  56.   set pPASweetSpotList = [585:"17,10",567:"16,28",594:"17,19",576:"17,1"]
  57.   set pSESweetSpotList = [458:"13,28",440:"13,9",449:"13,18",467:"13,36"]
  58.   set pPAPlayMovieLocList = ["243,290","242,275","230,288","247,288"]
  59.   set pPGSndList = ["EPHAUD1.AIF","EPHAUD2.AIF","EPHAUD3.AIF","EPHAUD4.AIF","EPHAUD5.AIF","EPHAUD5.AIF"]
  60.   set pPGSnd = getAt(pPGSndList,2)
  61.   set pFramesPerLineH = pMaxImageH * pQTFramesPerImage
  62.   set pAEFlyRightAnim = 3
  63.   MoveBar( 5 )
  64.   set pHandleRectList = the text of cast (getaProp(myCastList,#pHandleRectList))
  65.   set pStylusRectList = the text of cast (getaProp(myCastList,#pStylusRectList))
  66.   set pReelRectList = the text of cast (getaProp(myCastList,#pReelRectList))
  67.   set pShutterRectList = the text of cast (getaProp(myCastList,#pShutterRectList))
  68.   set pViewRectList = the text of cast (getaProp(myCastList,#pViewRectList))
  69.   set pAEBodyRectList = the text of cast (getaProp(myCastList,#pAEBodyRectList))
  70.   set pAEWingRectList = the text of cast (getaProp(myCastList,#pAEWingRectList))
  71.   set pMouthRectList = the text of cast (getaProp(myCastList,#pMouthRectList))
  72.   set pHayRectList = the text of cast (getaProp(myCastList,#pHayRectList))
  73.   set pEarRectList = the text of cast (getaProp(myCastList,#pEarRectList))
  74.   set pCylRectList = the text of cast (getaProp(myCastList,#pCylRectList))
  75.   set pCondRectList = the text of cast (getaProp(myCastList,#pCondRectList))
  76.   
  77.   set pArmRectList = the text of cast (getaProp(myCastList,#pArmRectList))
  78.   set pCursorReturnList = [21:#RETURN,22:#RETURN]
  79.   
  80.   
  81.   set pQTRect = rect(60, 80, 420, 440)
  82.   set pRotateDirectionList = [1:"0,-1",2:"1,-1",2:"1,0",3:"1,0",4:"1,1",5:"0,1",6:"-1,1",7:"-1,0",8:"-1,-1"]
  83.   
  84.   set pLabelTextCast = the number of cast "labelTxt"
  85.   set pDescriptionTextCast = the number of cast "descrTxt"
  86.   set pInstructionTextCast = the number of cast "instrTxt"
  87.   
  88.   set pSndPath = SndDirectoryPath
  89.   set pQTPath = QTDirectorypath
  90.   set pOrderedHotSpotRectList = []
  91.   set pMyStatus = 0
  92.   
  93.   return (me)
  94.   MoveBar( 5 )
  95.   
  96. end
  97. --
  98. on mSetNavQTFlags me
  99.   
  100.   if gInventorIndexNum = 1 then --edison
  101.     set pPhonoAnimFlag = the number of cast "phonoAnimFlag"
  102.     set pKGAnimFlag = the number of cast "KGAnimFlag"
  103.     set pStylusZoom1 =  the number of cast "EPHZM1B.MOV"
  104.     set pStylusZoom2 = the number of cast "EPHZM2.MOV"
  105.   else if gInventorIndexNum = 2 then  --bell
  106.     set pAEAnimFlag =  the number of cast "AEAnimFlag"
  107.     set pPAAnimFlag = the number of cast "PAAnimFlag"
  108.   else
  109.     set pSEAnimFlag =  the number of cast "SEAnimFlag"
  110.   end if
  111.   
  112. end mSetNavQTFlags
  113. --
  114. on mClose me
  115.   
  116.   mDeactivate me
  117.   
  118. end mClose
  119. ---
  120. on mDeactivate me
  121.   
  122.   if (soundBusy (pSndChannel)) then sound stop pSndChannel
  123.   mClearText (me)
  124.   mDeleteFromActorlist (gActorListMgrObj, me) 
  125.   mUnSetCursors (gUtilityObj)
  126.   set gActiveFunctionObj = empty
  127.   set the visible of sprite pQTsprite = TRUE
  128.   puppetsprite pQTplaySprite, FALSE
  129.   
  130. end
  131.  
  132. on mInitFoilPhono me
  133.   
  134.   cursor 4
  135.   set pTinFoilLoadText = the text of cast "TinFoi Load Text"
  136.   set pAcitiveAmbSnd = gactiveambsnd 
  137.   set pNavMovieCast = the number of cast "EPHNAV.MOV"
  138.   set pWhichNavMovie = #FoilPhono
  139.   set pOrderedHotSpotList = [#handle,#stylus,#QTRect]
  140.   set pOrderedCursorList = [#Operate, #ZoomIn, #Standard]
  141.   set pHotSpotStatus = #empty
  142.   set pCurrSweetSpotList = pPHSweetSpotList
  143.   set pRotateFrame = "rotateImage"
  144.   set pCurrExpText = the text of cast "PGOperateTxt"
  145.   set pRevealList = []
  146.   set pZoomList = ["stylusZoom1","stylusZoom2"]
  147.   set pLoadFoil = FALSE
  148.   set whichStartSweetSpot = 1
  149.   set startPoint = getAt(pPHSweetSpotList, whichStartSweetSpot)
  150.   set pSecondaryText =[the number of cast "PGOperateTxt" ,the number of cast "PGStylusZ1Txt"]
  151.   mplayIntroAudio (me)
  152.   set pBaseText = the text of cast "PhonoInstructions"
  153.   set the text of cast pInstructionTextCast = pBaseText
  154.   set gActiveFunctionObj = me 
  155.   set pActiveToolMenu = #None
  156.   mSetToolBtns (gInterfaceMgrObj, #TINFOIL, me)
  157.   mAddToActorlist (gActorListMgrObj, me)
  158.   set the visible of sprite pQTSprite = FALSE
  159.   set pCursorList = [21:#RETURN,22:#RETURN]
  160.   
  161. end
  162.  
  163. on mInitKinetograph me
  164.   
  165.   cursor 4
  166.   set pAcitiveAmbSnd = gactiveambsnd 
  167.   set pNavMovieCast = the number of cast "EKGNAV.MOV"
  168.   set pWhichNavMovie = #Kinetograph
  169.   set pOrderedHotSpotList = [#shutter,#viewer,#reel,#QTRect]
  170.   set pOrderedCursorList = [#ZoomIn,#ZoomIn,#Operate, #Standard]
  171.   set pHotSpotStatus = #empty
  172.   set pCurrSweetSpotList = pKGSweetSpotList
  173.   set pRotateFrame = "rotateKG"
  174.   set pCurrExpText = the text of cast "KGOperateTxt"
  175.   set pRevealList = []
  176.   set pZoomList = [ "viewZoom","shutterZoom"]
  177.   set whichStartSweetSpot = 2
  178.   set startPoint = getAt(pPHSweetSpotList, whichStartSweetSpot)
  179.   mplayIntroAudio (me)
  180.   set pSecondaryText =[the number of cast "KGShutterTxt",the number of cast "KGViewText" ]
  181.   set pBaseText = the text of cast "KinetoInstructions"
  182.   set the text of cast pInstructionTextCast = pBaseText
  183.   set gActiveFunctionObj = me 
  184.   mSetToolBtns (gInterfaceMgrObj, #KINGRAPH, me)
  185.   set pActiveToolMenu = #None
  186.   mAddToActorlist (gActorListMgrObj, me)
  187.   set the visible of sprite pQTSprite = FALSE
  188.   set pCursorList = [21:#RETURN,22:#RETURN]
  189.   
  190. end
  191.  
  192. on mInitSteamEngine me
  193.   
  194.   set pAcitiveAmbSnd = gactiveambsnd 
  195.   set pNavMovieCast = the number of cast "WSENAV1.MOV"
  196.   set pWhichNavMovie = #SteamEngine
  197.   set pOrderedHotSpotList = [#cylinder,#condenser,#arm,#QTRect]
  198.   set pOrderedCursorList = [#Reveal, #Reveal, #Operate, #Standard]
  199.   set pHotSpotStatus = #empty
  200.   set pCurrSweetSpotList = pSESweetSpotList
  201.   set pRotateFrame = "rotateSE"
  202.   set pCurrExpText = the text of cast "SEOperateTxt"
  203.   set pRevealList = ["playCylinder", "playCondenser"]
  204.   set pZoomList = []
  205.   set pSecondaryText =[the number of cast "SECylinderTxt" ,the number of cast "SECondenserTxt"  ]
  206.   mplayIntroAudio (me)
  207.   set pBaseText = the text of cast "SEInstructionTxt"
  208.   set the text of cast pInstructionTextCast = pBaseText
  209.   set gActiveFunctionObj = me 
  210.   mSetToolBtns (gInterfaceMgrObj, #STEAM, me)
  211.   set pActiveToolMenu = #None
  212.   mAddToActorlist (gActorListMgrObj, me)
  213.   set the visible of sprite pQTSprite = FALSE
  214.   set pCursorList = [21:#RETURN,22:#RETURN]
  215.   
  216. end
  217.  
  218. on mInitAerilon me
  219.   
  220.   cursor 4
  221.   set pNavMovieCast = the number of cast "BAENAV1.MOV"
  222.   set pWhichNavMovie = #Aerilon
  223.   set pAcitiveAmbSnd = gactiveambsnd 
  224.   set pOrderedHotSpotList = [#AEBody,#AEWing,#QTRect]
  225.   set pOrderedCursorList = [#Operate,#ZoomIn, #Standard]
  226.   set pHotSpotStatus = #empty
  227.   set pCurrSweetSpotList = pAESweetSpotList
  228.   set pRotateFrame = "rotateAE"
  229.   set pCurrExpText = the text of cast "AEOperateTxt"
  230.   set pRevealList = []
  231.   set pZoomList = ["playWing","wingZoom"]
  232.   
  233.   mSetCursors (gUtilityObj, pCursorReturnList)
  234.   mAddToActorlist (gActorListMgrObj, me)
  235.   mplayIntroAudio (me)
  236.   set pSecondaryText =[the number of cast "AEWingTxt" ,the number of cast "AEWingTxt" ]
  237.   set pBaseText = the text of cast "AEInstructionTxt"
  238.   set the text of cast pInstructionTextCast = pBaseText
  239.   set gActiveFunctionObj = me 
  240.   mSetToolBtns (gInterfaceMgrObj,#Aerilon, me)
  241.   set the visible of sprite pQTSprite = FALSE
  242.   set pActiveToolMenu = #None
  243.   set pCursorList = [21:#RETURN,22:#RETURN]
  244.   
  245. end
  246.  
  247. on mInitPhonautograph me
  248.   
  249.   cursor 4
  250.   set pNavMovieCast = the number of cast "BPANAV1.MOV"
  251.   set pWhichNavMovie = #phonautograph
  252.   set pOrderedHotSpotList = [#mouthpiece,#hayPiece,#earSection,#QTRect]
  253.   set pOrderedCursorList = [#Operate, #ZoomIn, #Reveal, #Standard]
  254.   set pHotSpotStatus = #empty
  255.   set pCurrSweetSpotList = pPASweetSpotList
  256.   set pRotateFrame = "rotatePA"
  257.   set pCurrExpText = the text of cast "PAOperateTxt"
  258.   set pRevealList = ["playEar"]
  259.   set pZoomList = ["playHay"]
  260.   set pAcitiveAmbSnd = gactiveambsnd 
  261.   mSetCursors (gUtilityObj, pCursorReturnList)
  262.   mAddToActorlist (gActorListMgrObj, me)
  263.   mplayIntroAudio (me)
  264.   set pSecondaryText =[the number of cast "PAHayTxt" ,the number of cast "PAEarTxt"  ]
  265.   set pBaseText = the text of cast "PAInstructionTxt"
  266.   set the text of cast pInstructionTextCast = pBaseText
  267.   set gActiveFunctionObj = me 
  268.   mSetToolBtns (gInterfaceMgrObj,#PhoneAuto, me)
  269.   set the visible of sprite pQTSprite = FALSE
  270.   set pActiveToolMenu = #None
  271.   set pCursorList = [21:#RETURN,22:#RETURN]
  272.   
  273. end
  274.  
  275. on mClearText me
  276.   
  277.   set the text of cast pDescriptionTextCast = " "
  278.   set the text of cast pInstructionTextCast = " "
  279.   
  280. end
  281.  
  282. on mSetPosition me, startPoint 
  283.   
  284.   if (pWhichNavMovie = #FoilPhono) then set startPoint = "13,1"
  285.   else if (pWhichNavMovie = #Kinetograph) then set startPoint = "13,19"
  286.   else if (pWhichNavMovie  = #SteamEngine) then set startPoint = "14,28"
  287.   else if ( pWhichNavMovie = #Aerilon) then set startPoint = "14,25"
  288.   else if ( pWhichNavMovie = #phonautograph ) then set startPoint = "15,5" 
  289.   
  290.   set pCurrImageV = value(item 1 of startPoint)
  291.   set pCurrImageH = value(item 2 of startPoint)
  292.   set pMyStatus = #dormant
  293.   set pImageNumber = ((pCurrImageV - 1) * pMaxImageH) + pCurrImageH
  294.   set frameNumber = pImageNumber * pQTFramesPerImage  - 1 
  295.   set the movieTime of sprite pQTSprite = frameNumber
  296.   set pLastFrameNum = frameNumber
  297.   set the visible of sprite pQTSprite = true
  298.   mPlaceMasks (me)
  299.   cursor - 1
  300.   
  301. end
  302.  
  303. on mMouseDownMsg me, whichSprite
  304.   
  305.   
  306.   sound stop pSndChannel
  307.   if (pHotSpotStatus = #QTRect) then 
  308.     --mSetCursors (gUtilityObj, [14:#ExpMd])
  309.     mDragNavMov (me)
  310.     set the text of cast pInstructionTextCast = pBaseText
  311.     set gMouseDownExp = TRUE
  312.   else mCheckIfMask (me)
  313.   
  314.   
  315. end
  316.  
  317. on mMouseUpMsg me
  318.   
  319.   if (pMyStatus = #dragging) then
  320.     set pMyStatus = #dormant
  321.     set pCurrImageV = pDragImageV
  322.     set pCurrImageH = pDragImageH
  323.     mAddToActorList(gActorListMgrObj,gInterfaceMgrObj)
  324.     mPlaceMasks (me)
  325.     cursor 0
  326.   end if
  327.   
  328. end
  329.  
  330. on mPerform me
  331.   
  332.   set currentMouseV = the mouseV
  333.   set currentMouseH = the mouseH
  334.   if (pMyStatus = #dragging) then mUpdateMovieFrame (me, currentMouseV, currentMouseH)
  335.   else 
  336.     mCheckCursor (me, currentMouseV, currentMouseH)
  337.     set gMouseDownExp = FALSE
  338.   end if
  339.   
  340. end
  341.  
  342. on mUpdateMovieFrame me, currentMouseV, currentMouseH
  343.   
  344.   mSetDirectionalCursor (me, currentMouseV, currentMouseH)
  345.   set deltaV = currentMouseV - pStartDragV
  346.   if (currentMouseH > pStartDragH) then set pStartDragH = pStartDragH + pFramesPerLineH 
  347.   set deltaH = pStartDragH - currentMouseH
  348.   set deltaV = deltaV/pPixToFrames
  349.   set deltaH = deltaH/pPixToFrames
  350.   set pDragImageV = pCurrImageV + deltaV
  351.   set pDragImageH = pCurrImageH + deltaH
  352.   if (pDragImageV < 1) then set pDragImageV = 1
  353.   else if (pDragImageV > pMaxImageV) then set pDragImageV = pMaxImageV
  354.   set pDragImageH = pDragImageH mod pMaxImageH
  355.   if (pDragImageH < 1) then set pDragImageH = pMaxImageH
  356.   set pImageNumber = ((pDragImageV - 1) * pMaxImageH) + pDragImageH
  357.   set pLastFrameNum = pImageNumber * pQTFramesPerImage  - 1
  358.   if  (the castnum of sprite pQTSprite <> 0) then
  359.     set the movieTime of sprite pQTSprite = pLastFrameNum
  360.   end if
  361.   if (the mouseDown = FALSE) then mMouseUpMsg (me)
  362.   
  363. end
  364.  
  365. on mSetDirectionalCursor me, currentMouseV, currentMouseH
  366.   
  367.   set deltaV = currentMouseV - pOldMouseV
  368.   set deltaH = currentMouseH - pOldMouseH
  369.   
  370.   if (deltaV < -5) then set cursorV = 1
  371.   else if (deltaV > 5) then set cursorV = 3
  372.   else set cursorV = 2
  373.   
  374.   if (deltaH < -5) then set cursorH = 1
  375.   else if (deltaH > 5) then set cursorH = 3
  376.   else set cursorH = 2
  377.   
  378.   set cursorValue = ((cursorV - 1) * 3) + cursorH
  379.   --    mUnSetOneCursor (gUtilityObj, 14)
  380.   mSetIndexedCursor (gUtilityObj, #Rotating, cursorValue)
  381.   set pOldMouseV = currentMouseV
  382.   set pOldMouseH = currentMouseH
  383.   
  384. end
  385.  
  386. on mCheckCursor me, currentMouseV, currentMouseH 
  387.   set mousePoint = point(currentMouseH,currentMouseV)
  388.   
  389.   set onHotSpot = false
  390.   set pHotSpotStatus = #empty
  391.   
  392.   repeat with hotSpotRect in pOrderedHotSpotRectList
  393.     if inside(mousePoint, hotSpotRect) then 
  394.       set whichPosition = getPos(pOrderedHotSpotRectList,hotSpotRect)
  395.       if whichPosition = 0 then exit repeat
  396.       if whichPosition > count(pOrderedCursorList) then exit repeat
  397.       set whichCursor = getAt(pOrderedCursorList, whichPosition)
  398.       mSetGeneralCursor (gUtilityObj, whichCursor) 
  399.       set pHotSpotStatus = getAt(pOrderedHotSpotList,whichPosition)
  400.       set onHotSpot = true
  401.       exit repeat
  402.     end if
  403.   end repeat
  404.   if onHotSpot = false then cursor 0
  405.   
  406. end
  407. --
  408. on mPlaceMasks me 
  409.   
  410.   if (pWhichNavMovie = #FoilPhono) then
  411.     set pHandleRect = value(line pImageNumber of pHandleRectList)
  412.     set pStylusRect = value(line pImageNumber of pStylusRectList)
  413.     set pOrderedHotSpotRectList = [pHandleRect, pStylusRect, pQTRect]
  414.   else if (pWhichNavMovie = #Kinetograph) then
  415.     set pReelRect = value(line pImageNumber of pReelRectList)
  416.     set pShutterRect = value(line pImageNumber of pShutterRectList)
  417.     set pViewRect = value(line pImageNumber of pViewRectList)
  418.     set pOrderedHotSpotRectList = [pShutterRect, pViewRect, pReelRect, pQTRect]
  419.   else if (pWhichNavMovie = #Aerilon) then
  420.     set pAEBodyRect = value(line pImageNumber of pAEBodyRectList)
  421.     set pAEWingRect = value(line pImageNumber of pAEWingRectList)
  422.     set pOrderedHotSpotRectList = [pAEBodyRect, pAEWingRect, pQTRect]
  423.   else if (pWhichNavMovie = #phonautograph) then
  424.     set pMouthRect = value(line pImageNumber of pMouthRectList)
  425.     set pHayRect = value(line pImageNumber of pHayRectList)
  426.     set pEarRect = value(line pImageNumber of pEarRectList)
  427.     set pOrderedHotSpotRectList = [pMouthRect, pHayRect, pEarRect, pQTRect]
  428.   else if (pWhichNavMovie = #SteamEngine) then
  429.     set pCylRect = value(line pImageNumber of pCylRectList)
  430.     set pCondRect = value(line pImageNumber of pCondRectList)
  431.     set pArmRect = value(line pImageNumber of pArmRectList)
  432.     set pOrderedHotSpotRectList = [pCylRect, pCondRect, pArmRect, pQTRect]
  433.   end if
  434.   
  435. end
  436.  
  437. on mDragNavMov me
  438.   
  439.   mDeleteFromActorList (gActorListMgrObj, gInterfaceMgrObj)
  440.   set pMyStatus = #dragging
  441.   set pStartDragV = the mouseV
  442.   set pStartDragH = the mouseH
  443.   set pOldMouseV = pStartDragV
  444.   set pOldMouseH = pStartDragH
  445.   
  446. end
  447.  
  448. on mCheckIfMask me, whichSprite
  449.   
  450.   cursor 4
  451.   
  452.   if (pWhichNavMovie = #FoilPhono) then
  453.     
  454.     if (pHotSpotStatus = #handle) then 
  455.       set nearestSweetSpot = mDetermineWhichSweetSpot (me, pCurrSweetSpotList)
  456.       mSetTargetVariables (me, nearestSweetSpot)
  457.       go frame "rotateImage"
  458.       set the text of cast pInstructionTextCast = the text of cast "PGOperateTxt" 
  459.     else  if (pHotSpotStatus = #stylus) then
  460.       set the visible of sprite pQTsprite = FALSE
  461.       go frame "stylusZoom1"
  462.       set the text of cast pInstructionTextCast = the text of cast "PGStylusZ1Txt"
  463.     end if
  464.     
  465.   else if (pWhichNavMovie = #Kinetograph) then
  466.     
  467.     if (pHotSpotStatus = #reel) then 
  468.       set nearestSweetSpot = mDetermineWhichSweetSpot (me, pCurrSweetSpotList)
  469.       mSetTargetVariables (me, nearestSweetSpot)
  470.       go frame "rotateKG"
  471.       set the text of cast pInstructionTextCast = the text of cast "KGOperateTxt" 
  472.     else if (pHotSpotStatus = #shutter) then 
  473.       set the visible of sprite pQTsprite = FALSE
  474.       go frame "shutterZoom"
  475.       set the text of cast pInstructionTextCast = the text of cast "KGShutterTxt"
  476.     else  if (pHotSpotStatus = #viewer) then 
  477.       set the visible of sprite pQTsprite = FALSE
  478.       set gEdisonFilmed = true
  479.       go frame "viewZoom"
  480.       set the text of cast pInstructionTextCast = the text of cast "KGViewText" 
  481.     end if
  482.     
  483.   else if (pWhichNavMovie = #Aerilon) then
  484.     
  485.     if (pHotSpotStatus = #AEBody) then
  486.       set nearestSweetSpot = mDetermineWhichSweetSpot (me, pCurrSweetSpotList)
  487.       mSetTargetVariables (me, nearestSweetSpot)
  488.       go frame "rotateAE"
  489.       set the text of cast pInstructionTextCast = the text of cast "AEOperateTxt" 
  490.     else  if (pHotSpotStatus = #AEWing) then 
  491.       set the visible of sprite pQTsprite = FALSE
  492.       go frame "playWing"
  493.       set the text of cast pInstructionTextCast = the text of cast "AEWingTxt"  
  494.     end if
  495.     
  496.   else if (pWhichNavMovie = #phonautograph) then
  497.     
  498.     if (pHotSpotStatus = #mouthpiece) then
  499.       set nearestSweetSpot = mDetermineWhichSweetSpot (me, pCurrSweetSpotList)
  500.       mSetTargetVariables (me, nearestSweetSpot)
  501.       go frame "rotatePA"
  502.       set the text of cast pInstructionTextCast = the text of cast "PAOperateTxt"
  503.     else if (pHotSpotStatus = #hayPiece) then 
  504.       set the visible of sprite pQTsprite = FALSE
  505.       go frame "playHay"
  506.       set the text of cast pInstructionTextCast = the text of cast "PAHayTxt"
  507.     else if (pHotSpotStatus = #earSection) then 
  508.       set the visible of sprite pQTsprite = FALSE
  509.       go frame "playEar"
  510.       set the text of cast pInstructionTextCast = the text of cast "PAEarTxt" 
  511.     end if
  512.     
  513.   else if (pWhichNavMovie = #SteamEngine) then
  514.     
  515.     if (pHotSpotStatus = #arm) then 
  516.       set nearestSweetSpot = mDetermineWhichSweetSpot (me, pCurrSweetSpotList)
  517.       mSetTargetVariables (me, nearestSweetSpot)
  518.       go frame "rotateSE"
  519.       mSetCursors (gUtilityObj, [21:#return,22:#return,6:#operate])
  520.       set the text of cast pInstructionTextCast = the text of cast "SEOperateTxt"
  521.     else  if (pHotSpotStatus = #cylinder) then 
  522.       set the visible of sprite pQTsprite = FALSE
  523.       go frame "playCylinder"
  524.       set the text of cast pInstructionTextCast = the text of cast "SECylinderTxt"
  525.     else if (pHotSpotStatus = #condenser) then 
  526.       set the visible of sprite pQTsprite = FALSE
  527.       go frame "playCondenser"
  528.       set the text of cast pInstructionTextCast = the text of cast "SECondenserTxt"
  529.     end if
  530.     
  531.   end if
  532.   set pHotSpotStatus = #empty
  533.   
  534. end
  535.  
  536. on mDetermineWhichSweetSpot me, sweetSpotList
  537.   
  538.   set shortestDistance = 1000 -- seed value
  539.   repeat with spotCounter = 1 to count(sweetSpotList)
  540.     set nextPoint = getPropAt(sweetSpotList,spotCounter)
  541.     set theDistance = abs(pImageNumber - getPropAt(sweetSpotList,spotCounter))
  542.     set theDistanceY = theDistance/pMaxImageH
  543.     set theDistanceX = theDistance - (pMaxImageH * theDistanceY)
  544.     set theDistance = theDistanceY + theDistanceX
  545.     if (theDistance < shortestDistance) then 
  546.       set shortestDistance = theDistance
  547.       set shortestDistancePoint = nextPoint
  548.       set pWhichSpotNum = spotCounter
  549.     end if
  550.   end repeat
  551.   set nearestSweetSpot = getAProp(sweetSpotList, shortestDistancePoint)
  552.   return (nearestSweetSpot)
  553.   
  554. end
  555.  
  556. on mSetTargetVariables me, targetPoint
  557.   
  558.   set pTargetVertical = value(item 1 of targetPoint)
  559.   set pTargetHorizontal =  value(item 2 of targetPoint)
  560.   if (pTargetVertical < pCurrImageV) then set pVertStep = -1
  561.   else set pVertStep = 1
  562.   if (pTargetHorizontal < pCurrImageH) then set pHorStep = -1
  563.   else set pHorStep = 1
  564.   
  565. end
  566.  
  567. on mMoveQTImage me
  568.   
  569.   
  570.   if (pTargetVertical = pCurrImageV) AND (pTargetHorizontal = pCurrImageH) then 
  571.     cursor 4
  572.     mDeleteFromActorlist (gActorListMgrObj, me) 
  573.     set the visible of sprite  pQTsprite = FALSE
  574.     if (pWhichNavMovie = #FoilPhono) then 
  575.       
  576.       if pLoadFoil then 
  577.         go "LoadFoil"
  578.         set pLoadFoil = FALSE
  579.       else 
  580.         go frame "playPhono"
  581.         mInitPlayPhono( me )
  582.       end if
  583.       
  584.     else if (pWhichNavMovie = #Kinetograph) then 
  585.       go frame "playKG"
  586.       mInitPlayKG me
  587.     else if (pWhichNavMovie = #Aerilon) then 
  588.       go frame "playAE" 
  589.       mInitPlayAE( me )
  590.     else if (pWhichNavMovie = #phonautograph) then 
  591.       go frame "playPA" 
  592.       mInitPlayPA (me)
  593.     else if (pWhichNavMovie = #SteamEngine) then 
  594.       go frame "playSE"
  595.       mInitPlaySE(me)
  596.     end if
  597.     cursor -1
  598.     
  599.   else
  600.     
  601.     if (pTargetVertical <> pCurrImageV) then set pCurrImageV = pCurrImageV + pVertStep
  602.     if (pTargetHorizontal <> pCurrImageH) then set pCurrImageH = pCurrImageH + pHorStep
  603.     set pImageNumber = ((pCurrImageV - 1) * pMaxImageH) + pCurrImageH
  604.     set pLastFrameNum = pImageNumber * pQTFramesPerImage  - 1 
  605.     set the movieTime of sprite pQTSprite = pLastFrameNum
  606.     go the frame
  607.     
  608.   end if
  609.   
  610. end
  611.  
  612. on mRotate me, whatrect
  613.   
  614.   set pActiveToolMenu = #rotate
  615.   set directionCordinates = getaProp(pRotateDirectionList,whatrect)
  616.   set stepH = item 1 of directionCordinates
  617.   set stepV = item 2 of directionCordinates
  618.   
  619.   repeat while (the mouseDown)
  620.     set pCurrImageV = pCurrImageV + stepV
  621.     if (pCurrImageV < 1) then set pCurrImageV = 1
  622.     else if (pCurrImageV > pMaxImageV) then set pCurrImageV = pMaxImageV
  623.     
  624.     set pCurrImageH = pCurrImageH + stepH
  625.     if (pCurrImageH < 1) then set pCurrImageH = pMaxImageH
  626.     else if (pCurrImageH > pMaxImageH) then set pCurrImageH = 1
  627.     
  628.     set pImageNumber = ((pCurrImageV - 1) * pMaxImageH) + pCurrImageH
  629.     set pLastFrameNum = pImageNumber * pQTFramesPerImage  - 1
  630.     set the movieTime of sprite pQTSprite = pLastFrameNum
  631.     updateStage
  632.   end repeat
  633.   
  634.   if (pActiveToolMenu <> #Load) then mClearToolHilite (gInterfaceMgrObj)
  635.   
  636.   set pCurrImageV = integer(pCurrImageV)
  637.   set pCurrImageH = integer(pCurrImageH)
  638.   
  639. end
  640.  
  641. on mOperate me, whichSpot
  642.   
  643.   mUnSetOneCursor (gUtilityObj, 16)
  644.   set pActiveToolMenu = #operate
  645.   if (whichSpot <= count(pCurrSweetSpotList)) then
  646.     
  647.     if (soundBusy (pSndChannel)) then sound stop pSndChannel
  648.     set pWhichSpotNum = whichSpot
  649.     set nearestSweetSpot = getAt(pCurrSweetSpotList, pWhichSpotNum)
  650.     mSetTargetVariables (me, nearestSweetSpot)
  651.     set pBaseQTlocV = the locv of sprite pQTSprite
  652.     set the locv of sprite pQTSprite = -1000
  653.     sound stop 1
  654.     updatestage
  655.     go frame pRotateFrame
  656.     set the text of cast pInstructionTextCast = pCurrExpText
  657.     
  658.   end if
  659.   
  660. end
  661. --
  662. on mReveal me, whichReveal
  663.   
  664.   cursor 4
  665.   mUnSetOneCursor (gUtilityObj, 16)
  666.   set pActiveToolMenu = #reveal
  667.   set the movierate of sprite pQTplaySprite = 0
  668.   set the locv of sprite pQTplaySprite = -1000
  669.   puppetsprite pQTplaySprite, false
  670.   sound stop 1
  671.   updatestage
  672.   
  673.   if (whichReveal <= count(pRevealList)) then
  674.     set revealFrame = getAt(pRevealList, whichReveal)
  675.     set the visible of sprite pQTSprite = FALSE
  676.     go frame revealFrame
  677.   end if
  678.   mClearToolHilite (gInterfaceMgrObj)
  679.   cursor -1
  680.   
  681. end
  682.  
  683.  
  684. on mZoom me, whichZoom
  685.   
  686.   puppetsprite pQTplaySprite, false
  687.   set the locv of sprite pQTplaySprite = -1000
  688.   updatestage
  689.   
  690.   cursor 4
  691.   mUnSetOneCursor (gUtilityObj, 16)
  692.   set pActiveToolMenu = #zoom
  693.   sound stop 1
  694.   set whatZoomFrame = getat(pZoomList, whichZoom)
  695.   set the visible of sprite pQTsprite = FALSE
  696.   
  697.   go whatZoomFrame
  698.   set the text of cast pInstructionTextCast = the text of cast getat(pSecondaryText,whichZoom)
  699.   mClearToolHilite (gInterfaceMgrObj)
  700.   cursor -1
  701.   
  702. end
  703.  
  704. on mLoad me, whichSnd
  705.   
  706.   cursor 4
  707.   puppetsprite pQTplaySprite, FALSE
  708.   mUnSetOneCursor (gUtilityObj, 16)
  709.   set pActiveToolMenu = #load
  710.   set pPGSnd = getAt(pPGSndList,whichSnd)
  711.   set gactiveambsnd = 0
  712.   sound stop 1
  713.   sound stop 2
  714.   updatestage
  715.   set startline =  (whichSnd -1) * 8 + 1
  716.   set the text of cast pInstructionTextCast = line startline to (startline + 8) of pTinFoilLoadText
  717.   mSetTargetVariables (me, "13,1")
  718.   set pWhichSpotNum = 2
  719.   go "rotateImage"
  720.   set pLoadFoil = TRUE
  721.   cursor -1
  722.   
  723. end
  724.  
  725. on mStartExplorable me      
  726.   
  727.   set the movieTime of sprite pQTSprite = 0
  728.   set the movieRate of sprite pQTSprite = 1
  729.   
  730. end
  731.  
  732.  
  733. on mInitPlayPhono me
  734.   
  735.   puppetSprite pQTplaySprite, true
  736.   set the castNum of sprite pQTplaySprite =  pPhonoAnimFlag + pWhichSpotNum
  737.   set the locH of sprite pQTplaySprite = 240
  738.   set the locV of sprite pQTplaySprite = 260 
  739.   sound stop 1
  740.   updatestage
  741.   set the movierate of sprite pQTplaySprite = 1
  742.   --set the volume of sprite pQTplaysprite =  255
  743.   
  744. end
  745.  
  746.  
  747.  
  748. on mStartAudio me
  749.   
  750.   sound stop 2
  751.   sound stop 1
  752.   updatestage
  753.   set whatsnd = gSndPath & pPGSnd
  754.   sound playfile 1, whatsnd
  755.   
  756. end
  757.  
  758.  
  759. on mInitPlayKG me
  760.   
  761.   puppetSprite pQTplaySprite, true
  762.   set the castNum of sprite pQTplaySprite =   pKGAnimFlag + pWhichSpotNum
  763.   set the locH of sprite pQTplaySprite = 240
  764.   set the locV of sprite pQTplaySprite = 260 
  765.   sound stop 1
  766.   updatestage
  767.   set the movierate of sprite pQTplaySprite = 1
  768.   set the volume of sprite pQTplaysprite =  255
  769.   
  770. end
  771.  
  772. on mInitPlayAE me
  773.   
  774.   if pWhichSpotNum = pAEFlyRightAnim then mPrepForZoom2 (me)
  775.   puppetSprite pQTplaySprite, true
  776.   set the castNum of sprite pQTplaySprite = pAEAnimFlag + pWhichSpotNum
  777.   set the locH of sprite pQTplaySprite = 240
  778.   set the locV of sprite pQTplaySprite = 260 
  779.   sound stop 1
  780.   updatestage
  781.   set the movierate of sprite pQTplaySprite = 1
  782.   set the volume of sprite pQTplaysprite =  255
  783.   
  784. end
  785.  
  786. on mInitPlayPA me
  787.   
  788.   puppetSprite pQTplaySprite, true
  789.   set the castNum of sprite pQTplaySprite = pPAAnimFlag + pWhichSpotNum
  790.   set movieLoc = getAt(pPAPlayMovieLocList,pWhichSpotNum)
  791.   set the locH of sprite pQTplaySprite = value(item 1 of movieLoc)
  792.   set the locV of sprite pQTplaySprite = value(item 2 of movieLoc)
  793.   sound stop 1
  794.   updatestage
  795.   set the movierate of sprite pQTplaySprite = 1
  796.   set the volume of sprite pQTplaysprite =  255
  797.   
  798. end
  799.  
  800.  
  801. on mInitPlaySE me
  802.   
  803.   puppetSprite pQTplaySprite, true
  804.   set the castNum of sprite pQTplaySprite = pSEAnimFlag + pWhichSpotNum
  805.   set the locH of sprite pQTplaySprite = 240
  806.   set the locV of sprite pQTplaySprite = 260
  807.   sound stop 1
  808.   updatestage
  809.   set the movierate of sprite pQTplaySprite = 1
  810.   set the volume of sprite pQTplaysprite =  255
  811.   
  812.   
  813. end
  814.  
  815. on mPrepForZoom2 me
  816.   
  817.   set cursorList = [:]
  818.   setaprop(cursorList,pBkgdSprite,#ZoomIn)
  819.   mSetCursors (gUtilityObj, cursorList)
  820.   
  821. end
  822.  
  823. on mCheckForZoom2 me
  824.   
  825.   if pWhichSpotNum = pAEFlyRightAnim then                   
  826.     puppetSprite pQTSprite, false
  827.     go frame "wingZoom"
  828.     sound stop 1
  829.     set the movierate of sprite pQTplaySprite = 1
  830.   else mCleanUpAfterPlaying me
  831.   
  832. end
  833.  
  834. on mPlayQT me
  835.   
  836.   if (the movieRate of sprite pQTplaySprite = 1) then go the frame
  837.   else 
  838.     set gActiveAmbSnd =  getat( ["EAMBIENT.AIF","BAMBIENT.AIF","WAMBIENT.AIF","GALLERY.AIF"], gInventorIndexNum )
  839.     set the locv of sprite pQTplaySprite = -1000
  840.   end if
  841.   
  842. end
  843.  
  844. on mCleanUpAfterPlaying me
  845.   
  846.   cursor 4
  847.   set gactiveambsnd = pAcitiveAmbSnd
  848.   puppetSprite pQTplaySprite, false
  849.   set the locv of sprite pQTplaySprite = -1000
  850.   sound stop 1
  851.   updatestage
  852.   set the visible of sprite pQTsprite = TRUE
  853.   set gactiveambsnd = pAcitiveAmbSnd 
  854.   if (pWhichNavMovie = #FoilPhono) then go frame "FoilBasePos"
  855.   else if (pWhichNavMovie = #Kinetograph) then go frame "KGbase"
  856.   else if (pWhichNavMovie  = #SteamEngine) then go frame "SEbase"
  857.   else if ( pWhichNavMovie = #Aerilon) then go frame "AEbase" 
  858.   else if (pWhichNavMovie = #phonautograph) then go frame "PAbase"
  859.   mPlaceMasks (me)
  860.   mUnSetOneCursor (gUtilityObj, 16)
  861.   mUnSetOneCursor (gUtilityObj, 6)
  862.   mResetCursors (me)
  863.   if (pActiveToolMenu <> #Load) then mClearToolHilite (gInterfaceMgrObj)
  864.   mAddToActorlist (gActorListMgrObj,me)
  865.   
  866. end mCleanUpAfterPlaying
  867.  
  868. on mResetCursors me 
  869.   
  870.   cursor 200
  871.   cursor -1
  872.   mUnSetOneCursor (gUtilityObj, pQTSprite)
  873.   updateStage
  874.   
  875. end
  876.  
  877. on mInitSTYZoom1 me
  878.   
  879.   set pAcitiveAmbSnd = gactiveambsnd
  880.   set gactiveambsnd = 0
  881.   sound stop 1
  882.   updatestage
  883.   set cursorList = [:]
  884.   setaprop(cursorList,pBkgdSprite,#ZoomIn)
  885.   mUnSetOneCursor (gUtilityObj, 18)
  886.   mSetCursors (gUtilityObj, cursorList)
  887.   updatestage
  888.   
  889.   put "pQTplaySprite " & pQTplaySprite
  890.   
  891.   set the movierate of sprite pQTplaySprite = 1
  892.   mStartAudio ( me )
  893.   
  894. end
  895.  
  896. on mInitPHZoom2 me
  897.   
  898.   
  899.   set cursorList = [:]
  900.   setaprop(cursorList,16,#ZoomOut)
  901.   set pAcitiveAmbSnd = gactiveambsnd
  902.   set gactiveambsnd = 0
  903.   sound stop 1
  904.   sound stop 2
  905.   updatestage
  906.   if (pWhichNavMovie = #FoilPhono) then
  907.     setaprop(cursorList,18,#operate)
  908.     mSetCursors (gUtilityObj, cursorList)
  909.     set the text of cast pInstructionTextCast = the text of cast "PGStylusZ2Txt" 
  910.   else if (pWhichNavMovie = #Kinetograph) then 
  911.     mSetCursors (gUtilityObj, cursorList)
  912.   else  if (pWhichNavMovie = #Aerilon) then 
  913.     mSetCursors (gUtilityObj, cursorList)
  914.     set the text of cast pInstructionTextCast = the text of cast "AEZoomTxt"
  915.   end if
  916.   set the movierate of sprite pQTplaySprite = 1
  917.   
  918. end
  919.  
  920. on mInitAEZoom1 me
  921.   
  922.   set pAcitiveAmbSnd = gactiveambsnd
  923.   set gactiveambsnd = 0
  924.   sound stop 1
  925.   updatestage
  926.   set cursorList = [:]
  927.   setaprop(cursorList,pQTSprite,#ZoomOut)
  928.   mSetCursors (gUtilityObj, cursorList)
  929.   set the movierate of sprite pQTplaySprite = 1
  930.   
  931. end
  932.  
  933. on mplayIntroAudio me
  934.   
  935.   
  936.   if (pWhichNavMovie = #FoilPhono) then set audioFile = gSndPath & "EPHINTR.AIF"
  937.   else if (pWhichNavMovie = #Kinetograph) then set audioFile = gSndPath & "EKGINTR.AIF"
  938.   else if (pWhichNavMovie  = #SteamEngine) then set audioFile = gSndPath & "WSEINTR.AIF"
  939.   else if ( pWhichNavMovie = #Aerilon) then set audioFile = gSndPath & "BAEINTR.AIF"
  940.   else if ( pWhichNavMovie = #phonautograph ) then set audioFile = gSndPath & "BPAINTR.AIF"
  941.   
  942.   sound playFile pSndChannel, audioFile
  943.   
  944. end
  945.  
  946. on mloopSnd me
  947.   
  948.   if (soundBusy (pSndChannel)) then go the frame
  949.   
  950. end
  951.  
  952.