HyperCard: Waiting for a QuickTime Movie to Finish (3/93)

The ability to play QuickTime movies in HyperCard is made possible using
HyperCard's XCMD interface. XCMDs are basically little programs that can
be executed using the HyperTalk language. Because they are separate
programs, however, they can execute concurrently with other HyperCard
scripts. A good example of this is the Movie XCMD provided in the
QuickTime Tools stack. All commands in a handler following a Play command
will execute while the movie is playing.

But what if I want to wait for the movie to finish before executing the
rest of my handler?

The Movie XCMD allows you to set a callBackMsg property which will be
automatically sent when the movie completes. You can use this command to
execute another handler when the movie completes.

Button script example:

on mouseUp
global TheMovieName
put "Claris Logo Movie" into TheMovieName
put the number of me into myButton
Movie TheMovieName,"Windoid","Card","Visible","Floating"
set the callBackMsg of window theMovieName to ┬
"send movieFinished to cd btn" && myButton
send "Play" to window TheMovieName
end mouseUp

on movieFinished
global TheMovieName
answer "The movie is done!"
close window TheMovieName
end movieFinished

This article is adapted from the Claris Tech Info database.

Support Information Services
Published Date: Feb 19, 2012