• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Controlling the Movie Clip > Generating Movie Clips Dynamically

Generating Movie Clips Dynamically

Creating movie clips on the fly—that is, during playback—opens a whole new world of exciting interactive possibilities. Imagine a game of Asteroids, in which enemy spaceships appear as the game progresses. You can store those enemy spaceships as movie-clip symbols in your library and create instances on the Stage with ActionScript as you need them. Or, if you want an infinite supply of a certain draggable item (such as merchandise) to be pulled off the shelf of an online store, you can make duplicates of the movie clip each time the viewer drags it away from its original spot. Or create after-images of a movie clip’s motion, much like onionskinning, by duplicating a movie clip and making it lag as it moves across the screen. All the while, you maintain the power to modify properties, control the position of the playhead in those Timelines, and use the clips like any other movie clips.

Flash has many methods that enable dynamically generated movie clips. Among them are duplicateMovieClip(), attachMovie(), and createEmptyMovieClip().


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint