Fourth World Logo Fourth World Media Corporation
  Embassy Services Products Resources   About Fourth World Contact  

IncWell Logo

SuperCard FAQ

4W Logo

How do I play a QuickTime movie?

SuperCard 2.5 and greater provides two different approaches to playing QuickTime movies: synchronously and asynchronously.

Synchronous playback uses the "play movie" command, and will play the movie according to the other parameters sent with that command, and will not execute other SuperTalk instructions or perform other processes until the move playback has finished.

Asynchronous playback was added as of SuperCard 2.5, and allows you to play QuickTime movies while other scripts are executing - even other "play movie" commands. Playing movies asynchronously involves three steps:

First, you must set the "movieIdle" property to true. This is a global property which determines whether SuperCard will allow processing of movie-related events while processing its own events. In some cases there may be a slight performance hit for this, as QuickTime must do its own processing each time through SuperCard's event loop, but this is necessary in order to allow QuickTime to keep playing while SuperCard does its thing. Because of this performance hit, the "movieIdle" property is initially set to false, and must be set to true in your scripts before asynchronous playback is possible.

Second, you must execute a "play movie" command, using the "show controller" option, which tells SuperCard that you want this movie to be registered for asynchronous playback. After executing such a "play movie" command, the global variable "it" will contain a numeric value called the "movie reference number." Techies will be pleased to note that this number is actually a pointer to the address of the movie info structure in memory, which makes the QuickTime handling in SuperCard very extensible.

Once you have this movie reference number, you can pass it to any number of calls to the new "movie" function. This function acts as the central switchboard for implementing all sorts of QuickTime control of asynchronous movies, such as playing specific frames, copying a frame image, getting and setting particulars of a movie such as its playback rect and location, and much more.

For details on synchronous playback, see the Script Language Guide entry for the keyword "movie". It may also be useful to review the chapter titled "Animation and Sound" in the SuperCard User Guide.