Displaying QTVR within
Director
Introduction
This tutorial uses Director 5 or 6. The QTVR must be a version 1 movie.
QuickTime 2.12 and the 16 or 32-bit version of QTVR Xtra must be also
correctly installed. In addition, if you are running this tutorial on a PC - the
QTVR movie you use must have been "flattened"
About the QTVR v 1.0 Xtra |
This Xtra is the only means to display QTVR movies in Director on a 16 bit PC or non PowerMacintosh.
It cannot be used with Shockwave.
On a PC, QuickTime 2.12 must be installed as well as or instead of QuickTime
3.0.
The Xtra, including documentation, is available on the Director 6.0 CD-ROM.
In most cases, it is better to use the QuickTime 3 Asset Xtra. |
1. Create a not transparent black quickdraw sprite on the stage with the
following dimensions:
Width
= 320
Height = 240
Left location = 40
Top location = 120 |
Other dimensions can be used but they must be a multiple of 4 pixels in
width and distance from the stage left. Put the sprite in channel 48. This
sprite will be used as a template for sizing the qtvr movie on the stage
2. Open the script window, create a startmovie handler and set up the
following as global variables:
set
whichmovie="qtvr.mov"
set wheremovie=the pathname
set whichsprite=48
set qtvrFile = wheremovie&whichmovie
set qtvrrect="40, 120, 360, 360" |
To display a QTVR movie the Xtra needs to know: where it is (in the same
directory as director movie), it's location and dimensions on stage and the
channel number of it's template sprite.
3. The Xtra must be initialised. Add the following lines to the startmovie
handler :
QTVREnter(xtra
"QTVRXtra")
set gQTVRObj = new(xtra "QTVRXtra") |
4. The QTVR movie will then be opened using the attributes defined in the
global variables above.
QTVROpen(gQTVRObj,
qtvrFile, qtvrRect, "visible") |
The "visible" property determines whether or not the QTVR movie is
visible on stage when it is first opened
5. Now open the script channel of the first frame and type the following:
on
exitFrame
global gQTVRObj,whichsprite
if isQTVRMovie(gQTVRObj) then
if rollover(whichsprite) then
QTVRMouseOver(gQTVRObj)
else
QTVRIdle(gQTVRObj)
cursor 200
cursor -1
end if
end if
go to the frame
end |
This script checks to see if a qtvr movie is open
and the mouse cursor
is over the qtvr movie (and acts accordingly)
6. Finally type this stopmovie handler:
on
stopmovie
QTVRclose(gQTVRObj)
QTVRExit(gQtVRObj)
set gQtVRObj=0
clearglobals
set the ink of sprite 48 =0
updatestage
set the ink of sprite 48 = 5
updatestage
end |
This handler properly closes the QTVR movie and memory used
by the Xtra is freed
< QTVR Tutorial site contents >