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

Chapter 7. Controlling the Movie Clip > Beginning to Animate with ActionScript

Beginning to Animate with ActionScript

The actions and methods discussed so far in this chapter—scripts that let you control and test virtually all aspects of the movie clip (appearance, position, draggability, collisions, depth level, duplication and creation, drawing capability, and masking capability)— are the basic tools for animating entirely with ActionScript. Whereas motion tweens and shape tweens are created before playback, ActionScript animation is generated during playback, so it can respond to and change according to your viewer’s actions. You can use the mouse properties _xmouse and _ymouse as parameters in movie-clip methods or to control movie-clip properties so that the location of your viewer’s pointer determines the behavior and appearance of graphics onscreen.

The following examples show how to use the mouse properties _xmouse and _ymouse to create responsive animations. The first example is a simple game of tag. You create a movie clip that follows your pointer, and if the movie clip catches up to you, you lose the game. The second example combines _xmouse and _ymouse with the movie-clip drawing methods so you can draw with the pointer. The third example is a scrolling menu that moves according to where the pointer is located.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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