Jeanne,

A while ago I was trying to figure out how to move an object in a angle
direction. You were kind enough to supply the following which works
perfectly *EXCEPT* it seems to move the object on the specified angle
*MINUS* 90 degrees.

I've tried to add that back in by using a "+90" in my script as follows but
am having no luck.

Anyone?

David

>Is there any way to move an object using any of the angle properties
>(arcangle, startangle, setangle, angle etc) instead of towards a specific
>x,y or relative (a certain distance x,y)?
>
>What math is involved if it's not possible using angle properties?

Basically you'll need to write a bit of custom code to translate the angle
into X and Y values, using trigonometry. The formulas are simple and
Revolution already contains the basic trig functions you'll need.

Suppose you want to move an object a distance of 200 pixels at an angle of
60 degrees. The horizontal or X distance is the total distance times the
cosine of 60 degrees, and the vertical or Y distance is the total distance
times the sine of 60 degrees. In Transcript this looks like this:

  put trunc(200 * cos(60 * pi/180)) into xDistance
  put trunc(200 * sin(60 * pi/180)) into yDistance

(The pi/180 is to convert degrees to radians - Transcript trig functions
work in radians rather than degrees.) Now you have the distances involved,
and can use e.g. the move command:

  move graphic "My Graphic" relative xDistance,yDistance

If any of this is confusing or you need more help, please let me know.

-----------------------------

David Janik-Jones | RKD, Inc.

853 Alma Street | Palo Alto, CA 94301
650.324.1355 x13 | Fax 650.324.2968
[EMAIL PROTECTED] | www.rkdinc.com

Reply via email to