2 Replies Latest reply on Jul 19, 2006 3:20 PM by Bill O

    converting a _rotation to a 360 degree output

    Bill O Level 1
      I was coding out a compass and was running into trouble with the reporting of a movie clip's own rotation. It was reporting negative rotation for anything with a a rotation over 180 degrees (181 degrees would be reported as -179 degrees) - this behavior is clearly spelled out in the documentation.

      Anyway, I was converting strings retrieved from an XML source for compass direction ( N, S, E, W, SSE, SE, ESE, etc. ) to numbers using a switch clause. So N=0, E=90, S=180, W = 270, etc. (fill in the blanks).

      To get my rotation to evaluate correctly for a full range of 360 degrees, I came up with this function: