home *** CD-ROM | disk | FTP | other *** search
- -- MovieFrameScript
- --
- -- MovieFrameScript
- -- When run frequently, provides cursor feedback over the pano movie
- -- and handles mouse down and keyboard actions.
- -- Call from a looping frame script
- -------------------------------------------------------------------------------
- on MovieFrameScriptXtra pSpriteNum
- global gQTVRInstanceXtra, gLastTimeRollover, gOnPC, gHotSpot
- if rollover(pSpriteNum) then
-
- -- running this script will set an invisible movie back to visible,
- -- so test for visibility first
- -- note that you can remove this test if you're not doing anything with the "visible" property
- if QTVRGetVisible(gQTVRInstanceXtra) then
-
- -- mac xtra uses "RunningInForeground()" XFCN, but there's nothing on
- -- the win side for that, so we'll just gloss over it on the PC
- if gOnPC then set foregroundFlag = "true"
- else set foregroundFlag = RunningInForeground()
-
- -- Only run mouseOver if there's a movie AND Director is in the foreground
- if IsQTVRMovie(gQTVRInstanceXtra) and foregroundFlag = "true" then
-
- -- Result is 0 if you just wandered over the window
- -- without mousing down, if you zoomed in or out without
- -- mousing down, if you used the arrow keys, or if there
- -- was an unhandled event
- put QTVRMouseOver(gQTVRInstanceXtra) into tMouseOverResult
-
- if tMouseOverResult <> 0 then
- put item 1 of tMouseOverResult into tAction
- case tAction of
- "jump":
- --put item 2 of tMouseOverResult into member "Current Node ID"
- --put item 2 of tMouseOverResult
- "stil":
- --put item 2 of tMouseOverResult into member "Current Hot Spot ID"
- --put item 2 of tMouseOverResult
- "navg":
- --processNavgResult tMouseOverResult
- "misc":
- --put item 2 of tMouseOverResult into member "Current Hot Spot ID"
- --put item 2 of tMouseOverResult
- "undf":
- --put item 2 of tMouseOverResult into member "Current Hot Spot ID"
-
- --refresh hotspot ID
- -- JHB
- put item 2 of tMouseOverResult into gHotSpot
- checkVRHotSpotClick
- put item 2 of tMouseOverResult
- "pan ": -- Watch out for that space!
- nothing
- end case
-
-
- put true into gLastTimeRollover
-
- else if rollover(pSpriteNum) then
- -- There was an arrow key event or some unhandlable event,
- -- but cursor is still over panoramic window
- put true into gLastTimeRollover
-
- else
- -- The cursor is no longer over the panoramic window
-
- -- Set the cursor twice because Director
- -- doesn't change the cursor if your current cursor command
- -- is the same as the last one. It doesn't realize of course,
- -- that QTVR has changed the cursor in between.
-
- -- It appears that the cursor command is ignored if the mouse
- -- is not over the stage, so if you move out of the movie window
- -- fast enough and off the stage, the cursor will remain unchanged.
-
- cursor 200
- cursor -1
- put false into gLastTimeRollover
- end if
- end if
- else if gLastTimeRollover then
- -- See comment(s) above
- cursor 200
- cursor -1
- put false into gLastTimeRollover
- end if
- else if gLastTimeRollover then
- -- See comment(s) above
- cursor 200
- cursor -1
- put false into gLastTimeRollover
- end if
-
- if IsQTVRMovie(gQTVRInstanceXtra) then
- QTVRIdle(gQTVRInstanceXtra)
- end if
-
- end
-
-
- -------------------------------------------------------------------------------
- -- processNavgResult
- --
- -- Called from above handler when the result of "QTVRMouseOver" is "navg"
- -- Collapses pano to object. Attempts to open object movie in same directory as
- -- pano. Zooms object movie. If object can't be opened goes back to pano
- -------------------------------------------------------------------------------
- on processNavgResult pMouseOverResult
- global gQTVRInstanceXtra, gLastPanoMovieData, gPathName, gOldFile, gFileName, gOldNode
-
- put item 2 of pMouseOverResult into tHotSpotID
- put tHotSpotID into member "Current Hot Spot ID"
-
- -- We rely on all navigable objects having their all their properties
- -- correctly authored. It is unclear what will happen if the properties
- -- aren't set up correctly.
-
- put QTVRGetObjectViewAngles(gQTVRInstanceXtra) into tViewAngles
- put QTVRGetHotSpotName(gQTVRInstanceXtra) into tFileName
-
- -- stash pano filename & node so we can go back to it
- set gOldFile = gFileName
- set gOldNode = QTVRGetNodeID(gQTVRInstanceXtra)
-
- OpenMovie gPathName & ":" & tFileName, 1, "invisible"
-
- if IsQTVRMovie(gQTVRInstanceXtra) then
- -- Show the object controls and take us to the right view of the object
- go to frame "Object From Pano"
- SetMovieView item 1 of tViewAngles, item 2 of tViewAngles, 0
- else
- -- Well, we couldn't open the object, so reupdate the panorama
- OpenMovie gOldFile, 1, "visible"
- QTVRUpdate(gQTVRInstanceXtra)
- end if
- end
-
-