1. Home
  2. Computing & Technology
  3. Animation

Dynamic Animation in Flash: Moving Dynamically Drawn Shapes

By , About.com Guide

6 of 7

Because the drawing is contained inside a movie clip, you can animate it the same way that you might animate an object that you drew on-stage rather than having to redraw each line to give the illusion of animation. All you need is another onClipEvent and the x and y coordinates of the movie clip:
onClipEvent (enterFrame) {
_root.box._x+=1;
_root.box._y+=1;
}

Each time the movie clip’s timeline cycles through its single frame, Flash gets the x and y coordinates in pixels of the square’s center and adds one to it, moving it to the right and down. Animation, but short-lived animation as it moves off the screen and continues moving perpetually. In the next step we’ll shake things up a little.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Dynamic Animation in Flash: Moving Dynamically Drawn Shapes

©2009 About.com, a part of The New York Times Company.

All rights reserved.