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.

Thanks in advance,

Cërf.
LVL 8
CerfAsked:
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.

negatyveCommented:
this is a good script to start from.

onClipEvent(load){
      speed=5;
      radius=100;
      xcenter=200;
      ycenter=140;
      angle=0;
}
onClipEvent(enterFrame){
      _x = Math.cos(angle*Math.PI/180)*radius+xcenter;
      _y = Math.sin(angle*Math.PI/180)*radius+ycenter;
      angle += speed;
      if (angle > 359)angle -= 360;
}

are you using flash mx?
0
CerfAuthor Commented:
yes,
should I start trying that already?
0
CerfAuthor 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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

CerfAuthor Commented:
Ok,
http://es.geocities.com/cerfx/flash/ and look for Q_21193604.swf it is just an image (3kb)
0
CerfAuthor 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
muso120999Commented:
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
CerfAuthor 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
muso120999Commented:
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

Your issues matter to us.

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

Start your 7-day free trial
CerfAuthor 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.