Articles Archive
Articles Search
Director Wiki
 

Waiting for my QT

October 23, 1997
by Pat McClellan

Dear Multimedia Handyman
I want to have the watch cursor appear while the Quicktime video clips are being accessed from the CD-ROM. I know you can use the "cursor 4" command, but I'm not sure where to put it or where to turn it off.

Signed,

"Waiting for my QT"

Dear Waiting,

This is a great idea. A small wait while the CD-ROM accesses the video is made more tolerable if the user knows something is happening. The watch cursor will suggest that the movie is loading.

Before we get to the Lingo, let me suggest some ways to minimize the wait time for accessing videos on a CD-ROM. When you prepare the files to be burned to the CD, make sure that the videos get written to the disc first.

For a Mac disc, that means putting the videos into the disk partition first, then adding your Director Movies. For a PC disk, your CD burning software should allow you to arrange the files to be written in the order you want. Also, if your CD Burning software allows it, select "optimize for speed" (as opposed to "optimize for space").

In your Director movie, let's assume that frame "MENU" displays a menu of several videos. The frame script for your menu frame says "go to the frame" to maintain a loop. When the user clicks on the icon sprite for a video, the Director movie jumps to a frame in which the QT plays, then returns to frame "MENU".

In frame "MENU", adapt the following script for each of the icon buttons, inserting the names of each of the frames in which the QT plays:


on mouseUp
  cursor 4
  -- changes cursor to the watch
  go to frame "video 1"
  -- change the name of the frame
end

Assume that the QT movie is in sprite 7 in each of the frames. In the script channel of each of the frames in which the QT plays, we'll monitor the state of the QT movie, and give instructions accordingly. First we'll see if the movie has started playing yet by checking "the movieTime" property (which is like the counter on a VCR.) If the movieTime of sprite 7 (our video sprite) is greater than 1, then we know that the movie has started playing. If so, then we'll change the cursor back to normal.


if the movieTime of sprite 7 > 1 then
  cursor 0

We also need to check to see if the movie is over. The easiest way to check this is to compare the movieTime to "the duration". If the movieTime is equal to the duration, then we know that the movie is finished and we should return to frame "MENU". Note the use of "else if...".


else if the movieTime of sprite 7 = ¬
  the duration of sprite 7 then
  go to frame "MENU"
  exit
end if

Finally, we need to add "go to the frame" so that we loop in the frame until the video is over. The entire script looks like this:

The "exit" command in the else-if statement tells Director to skip the rest of the handler (the "go to the frame" part) so that it can jump immediately to frame "MENU".

Good luck with your project.

Patrick McClellan is Director Online's co-founder. Pat is Vice President, Managing Director for Jack Morton Worldwide, a global experiential marketing company. He is responsible for the San Francisco office, which helps major technology clients to develop marketing communications programs to reach enterprise and consumer audiences.

Copyright 1997-2024, Director Online. Article content copyright by respective authors.