View Full Version : Example: Showing a Wait Dialog While a Video Loads

05-12-2004, 12:59 PM
When a video is loaded from a CD-ROM drive there can be some delay depending on the target system and the size of the video file. Here is an example of a few lines of code that will improve the look of that load time. This example assumes that you are using a Video.load() action to load a video into an existent video object.

Place this code into the location that is calling the load action:

-- Show the default status dialog
StatusDlg.Show(MB_ICONINFORMATION, false);
-- Set the message that appears
StatusDlg.SetMessage("Loading Video... Please wait");
-- Set the title of the dialog
StatusDlg.SetTitle("Loading Video");
-- Load the video into an existent video object
Video.Load("Video1", "AutoPlay\\Videos\\LargeVideo.mpeg", true, false);

Now you must turn off the status dialog once the video has finished loading and is starting to play. Place this code into the "On Play" event of the Video Object

-- Hide the dialog