home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00504_Script_movieFrameScript
< prev
next >
Wrap
Text File
|
1997-07-24
|
5KB
|
129 lines
-- 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 MovieFrameScript pSpriteNum
global gQTVRInstance, gLastTimeRollover, gOnPC
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(gQTVRInstance) 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(gQTVRInstance) 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(gQTVRInstance) 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"
"stil":
put item 2 of tMouseOverResult into member "Current Hot Spot ID"
"navg":
processNavgResult tMouseOverResult
"misc":
put item 2 of tMouseOverResult into member "Current Hot Spot ID"
"undf":
put item 2 of tMouseOverResult into member "Current Hot Spot ID"
"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(gQTVRInstance) then
QTVRIdle(gQTVRInstance)
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 gQTVRInstance, 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(gQTVRInstance) into tViewAngles
put QTVRGetHotSpotName(gQTVRInstance) into tFileName
-- stash pano filename & node so we can go back to it
set gOldFile = gFileName
set gOldNode = QTVRGetNodeID(gQTVRInstance)
OpenMovie gPathName & ":" & tFileName, 1, "invisible"
if IsQTVRMovie(gQTVRInstance) 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(gQTVRInstance)
end if
end