7.
How to avoid blocking
Just insert a line into the script loop.
while (...)
{
some code...
if (!processMsg()) return;
} |
The "processMsg" allows the main
movie to continue to play. So even if the while
clause takes long time to finish, the main movie
still can play as usual.
The "processMsg" methods returns
false if the user clicks the "x" button
of the main window. In this case, we must jump
out of the while clause to exit the running
program.
The sample reads data from a mdb database and
writes to a text file. A progress bar in the
demo shows the progress of the reading and writing.
|