I want to animate an mc along a perfect circle such that it appears to rotate around a point. I have examind the various MoveOn* classes which, on the surface, would do what I want to do except that it seems it is difficult to draw a perfect circle using a curve, quad curve or cubic curve.
Any idea what would be the best approach here?
Do I need to work out how to draw a perfect circle using one of the curve options or is there another way?
If I need to draw a circle using the curve options, any hints for doing this (i.e. how do I know what the coordinates for the points and control points are, particularly if I need to create circle of different diameters)?
Thanks
Adrian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2005-09-07
Having done some more reading and thinking, I think there may be a more elegant solution to animating movie clips around a perfect circle.
Looking through Robert Penner's "Programming Flash MX" I realised that the radius of the circle connecting its center and the mc to be animated is a simple 2D vector which is easily rotated using the code provided in the book. Pairing this with the Animator class in Animation Package provides a simple means to animate mc's around a perfect circle given the circle's radius and x,y coords of the center.
I'll try this and feed back on my success or lack of!
Cheers
Adrian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW: I was planning to implement a MoveOnShape class that can move shapes around an arbitrary path. Thomas Pfeiffer has offered his ShapeTracer class for this task. Nevertheless, I can't find the time to integrate it into AP. If you want to work on it, send me an email and I'll send you the current early versions of those classes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2005-09-14
Well, I eventually found an even simpler solution...
I created a movie clip where the centre of my imaginery perfect circle would be (let's call this 'holder_mc'). Inside this I created the movie clip I want to animate around the imaginery circle and offset it in _y by an amount equal to the radius of the imaginery circle. Then I just use Rotation to animate 'holder_mc'.
Works a treat!
(Regards working on the MoveOnShape class - I wish I could but I'm currently extremely short of time as it is! I will see if I can make some time for it when these projects are over)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to animate an mc along a perfect circle such that it appears to rotate around a point. I have examind the various MoveOn* classes which, on the surface, would do what I want to do except that it seems it is difficult to draw a perfect circle using a curve, quad curve or cubic curve.
Any idea what would be the best approach here?
Do I need to work out how to draw a perfect circle using one of the curve options or is there another way?
If I need to draw a circle using the curve options, any hints for doing this (i.e. how do I know what the coordinates for the points and control points are, particularly if I need to create circle of different diameters)?
Thanks
Adrian
Having done some more reading and thinking, I think there may be a more elegant solution to animating movie clips around a perfect circle.
Looking through Robert Penner's "Programming Flash MX" I realised that the radius of the circle connecting its center and the mc to be animated is a simple 2D vector which is easily rotated using the code provided in the book. Pairing this with the Animator class in Animation Package provides a simple means to animate mc's around a perfect circle given the circle's radius and x,y coords of the center.
I'll try this and feed back on my success or lack of!
Cheers
Adrian
That's the approach to go for now.
BTW: I was planning to implement a MoveOnShape class that can move shapes around an arbitrary path. Thomas Pfeiffer has offered his ShapeTracer class for this task. Nevertheless, I can't find the time to integrate it into AP. If you want to work on it, send me an email and I'll send you the current early versions of those classes.
http://www.flashyok.net/kiroukou/index.php?page=travaux&lang=en
Well, I eventually found an even simpler solution...
I created a movie clip where the centre of my imaginery perfect circle would be (let's call this 'holder_mc'). Inside this I created the movie clip I want to animate around the imaginery circle and offset it in _y by an amount equal to the radius of the imaginery circle. Then I just use Rotation to animate 'holder_mc'.
Works a treat!
(Regards working on the MoveOnShape class - I wish I could but I'm currently extremely short of time as it is! I will see if I can make some time for it when these projects are over)