For example, to manipulate the playhead of a movie clip, we can call
the gotoAndPlay( ) function
with a frame number as a parameter:
gotoAndPlay(5);
If you are a new programmer, you may be experiencing an epiphany. You
hopefully will have noticed that you invoke built-in functions using
the function-call operator (the parentheses) and a parameter list
(the value 5 in this case) just like our custom user-defined
functions! Built-in functions, such as gotoAndPlay(
), are used just like the functions we've been
building ourselves. Naturally, the built-in functions do different
things than our custom functions, and there is no sense in writing a
custom function to do something that a built-in ActionScript function
already offers. But like any custom function, each built-in function
has a name, optional parameters, and a return value (although
sometimes it's undefined).
Easy stuff once you've become comfortable with using functions.
ActionScript's built-in functions are many and varied. They
give us control over the elements of a movie, empowering us to
examine and change everything from the volume of a sound to the
amount of text selected in an editable text field. For an exhaustive
list of ActionScript's built-in functions, consult Part III, "Language Reference". Skim it periodically to familiarize yourself
with the type of functions that are available, although there is no
need to memorize their specific syntax.