Welcome to the second article in our series on Flash motion using ActionScript. In the first article, I looked at how you could move an object in a straight line using ActionScript. In this article, I'll look at creating circular motion - moving an object in a circle around another object. By the end of this article, you'll be able to create a function that you can reuse throughout your movies.
This article is a little more involved than the first article and it involves some basic trigonometry. Don't worry, it's not that difficult to follow, even if you can't remember much math from your high school days!
I've assumed that you are using Flash MX or Flash MX 2004 and that know how to add ActionScript to a movie. I've used ActionScript 1.0 for the examples.
You can download the source files for the tutorial from the blue Properties box that contains the article PDF. There's a heading titled Code Download and you can click the Details link next to it to get the zip file. The download includes the starter files you'll need as well as the completed files.
Hello. I'm the Principal of Anything Is Possible, an Australian web development business specialising in web applications development and training. I'm interested in using Flash with dynamic content and I've presented at a number of International conferences on topics relating to applications development, XML and scripting components. I have recently released my second print book Beginning XML with DOM and Ajax to match the first one - Foundation XML for Flash. I have a business web site and a personal web site.