# Arc trajectory mc

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.

Cërf.
LVL 8
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
this is a good script to start from.

speed=5;
xcenter=200;
ycenter=140;
angle=0;
}
onClipEvent(enterFrame){
angle += speed;
if (angle > 359)angle -= 360;
}

are you using flash mx?
0
Author Commented:
yes,
should I start trying that already?
0
Author Commented:
hmm, watching the script, I can see that it uses a center to do the arc.
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...
0
Author Commented:
Ok,
http://es.geocities.com/cerfx/flash/ and look for Q_21193604.swf it is just an image (3kb)
0
Author Commented:
now, what I want to accomplish is the following,
..[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?
0
Commented:
I don't want any points for this comment, but...

> 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
0
Author Commented:
hi,
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.
0
Commented:
I have written a function previously here:
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21162904.html

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
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
Hey there, sorry I have been out for a while,
I didn't implement any of the solutions since I was in a hurry, although I'm sure that working those out I'd get what I needed.

Thank you.

Cërf.
0