onClipEvent(load){

speed=5;

radius=100;

xcenter=200;

ycenter=140;

angle=0;

}

onClipEvent(enterFrame){

_x = Math.cos(angle*Math.PI/180

_y = Math.sin(angle*Math.PI/180

angle += speed;

if (angle > 359)angle -= 360;

}

are you using flash mx?

Solved

Posted on 2004-11-03

Hello there,

I have a mc that I need to move from point A to point B, I don't want it to move straight but to describe an arc trajectory.

I know one of the options is to have an empty mc with the onClipEvent(enterframe) checking if the point A = point B, and then if not, do the math to get it there. If possible, I'd like to stick to that, I just need the appropiate equations.

Thanks in advance,

Cërf.

I have a mc that I need to move from point A to point B, I don't want it to move straight but to describe an arc trajectory.

I know one of the options is to have an empty mc with the onClipEvent(enterframe) checking if the point A = point B, and then if not, do the math to get it there. If possible, I'd like to stick to that, I just need the appropiate equations.

Thanks in advance,

Cërf.

9 Comments

onClipEvent(load){

speed=5;

radius=100;

xcenter=200;

ycenter=140;

angle=0;

}

onClipEvent(enterFrame){

_x = Math.cos(angle*Math.PI/180

_y = Math.sin(angle*Math.PI/180

angle += speed;

if (angle > 359)angle -= 360;

}

are you using flash mx?

from what I need to do, that center will change, how can I recalculate it?

Hold on, let me put together a little graphic to illustrate it better...

Ok,

http://es.geocities.com/cerfx/flash/ and look for Q_21193604.swf it is just an image (3kb)

http://es.geocities.com/ce

..[numbers in the image]..

first state [1],

on rollOver option1 [2],

on rollOut option1, return to the previous state, but if from rollover1 I move the mouse to option2 then [3]

is it too confusing?

> that center will change, how can I recalculate it?

I've had a look at your graphic, and, to me, it looks like the mini circle option is rotating around a constant origin that is the centre of the bigger circle! In what way is the centre changing? If the bigger circle is moving left/right with the options too, you could simply adjust negatyve's xcenter variable in the onEnterFrame event

muso

Thanks for the input muso!

Actually, if you didvide the distance between the points by 2 and project a perpendicular line from that center you can change the center accurately, however, the problem I'm having now is that I need to figure out how can I express that movement in terms of XY instead of an angle.

negatyve, are you still there?

Cërf.

http://www.experts-exchang

coord takes an angle and a radius, and returns to an object with x and y distance - you adapt this to use it to calculate your x and y movement...

Just a thought!

muso

Title | # Comments | Views | Activity |
---|---|---|---|

SCCM 2012 - Deploy Flash | 16 | 6,778 | |

Flash movie or gif/animation? | 3 | 810 | |

Virus or Outlook 2007 problem, how to tell? | 8 | 64 | |

How to add jQuery and JavaScript(s) into Dreamweaver? | 1 | 232 |

The goal of the tutorial is to teach the user how to how to record live broadcast.

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**18** Experts available now in Live!