The StartMovie() handler is the first handler executed when your program begins to run (hence its name).
There is another handler, called StopMovie(), which runs whenever the
program stops running (that is, generally, when the user quits the
program).
For this first program we will not be defining a
StopMovie() handler, but they do exist, and we will need them later, so
remember that they're there.
Note that handler names, when called from within another handler or when being described, have parentheses following them.
Note also that handler names are capitalized initially, and that when
they are actually defined within the script as opposed to being called
from another handler, there are no parentheses following.
If you put parentheses at the top of a handler
definition, you will get an error. So why use parentheses when calling
a handler from another handler or when referring to it? To let the
reader — you or another programmer — know right away what what s/he is
reading is either a handler call or a handler definition , based simply
on conventional syntax. This saves you having to write tons of comment
lines later on.
Overall neither of these conventions is crucial
to making a workable Director program, but these conventions are pretty
standard in the world of programming and will be used everywhere on
this site.
We'll explore parentheses and their uses later.
For now, use this form as your standard way of writing a script. Good
habits, remember...?
|
|