
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Creating Movie Clips
|
331
In a movie that makes heavy use of duplicateMovieClip() to dynamically generate
content, it’s common to see a row of seed clips on the outskirts of the movie canvas.
The seed clips are used only to derive duplicate clips and are, therefore, kept off
stage.
Creating Movie Clips
We usually treat movie clips just as we treat objects—we set their properties with the
dot operator; we invoke their methods with the function-call operator (parentheses);
and we store them in variables, array elements, and object properties. We do not,
however, create movie clips in the same way we create objects. We cannot literally
describe a movie clip in our code as we might describe an object with an object lit-
eral. And we cannot generate a movie clip with the new operator:
myClip = new MovieClip( ); // Nice try buddy, but it won't work
Although Flash Player 6 supports the new MovieClip() command, that command
establishes a MovieClip subclass; it cannot be used to create a new movie clip instance
in a movie. Instead, we normally create movie clips directly in the authoring tool, by
hand. Once a clip is created, we can use commands such as duplicateMovieClip() and
attachMovie() to make new, independent duplicates of it. As of Flash Player 6, we can
also create a completely new movie ...