ActionScript 2.0 Rotation Classes

UNITECH - 2005

Go to previous image
Go to next image

Click the image to view SWF file in a new window.
Drag the square to rotate the base. Drag mouse along the length of the scope to rotate it.

This file shows off some development work I did for an ARNG theodolite course. In setting up a theodolite, the user must perform a series of steps involving rotating the base and telescope unit. To mimic that on-screen, I developed a couple of AS 2.0 classes to make the functionality easier to implement. The scope rotation depicted above, is done by determining the distance the mouse has been dragged along the scope, converting that into degrees of rotation, then turning that into a frame number to be displayed from the MovieClip. The illusion is of an object being rotated about an axis parallel to the viewing plane.