Rotation Property

Rotation Property

Flash CS4 ActionScript 3.0 Tutorial

 

How to Assign Rotation Property to Button Symbols, Movie Symbols and Text with Flash ActionScript

 

 

The rotation property determines the object's rotation about its registration point. The values are set in degrees and measured in a clockwise direction. For more information about setting and moving the registration point, see topic, Setting and Moving Object Registration Point.

Tutorial Elements

Movie Symbol with instance name rotateMovie_mc

 

Step One

Add a Movie Symbol to the stage.

Step Two

Select the object and open the Properties panel (Cmd/F3 (PC-Ctrl/F3)). Type in the name rotateMovie_mc for the Instance Name.

Step Three

Add a new layer called Actions.

Step Four

Option double-click (PC - Alt double-click) the keyframe in the Actions layer to open the ActionScript panel.

Step Five

Copy/Paste the following code to the ActionScript panel.

rotateMovie_mc.rotation = 90;

Step Six

Test your movie by pressing Cmd/Return (PC - Ctrl/Enter). By setting the rotation value to 90, the object rotates 90 degrees in a clockwise direction.

Object Properties and Events

By combining Object Properties and Events (i.e., Enter Frame Events or Mouse Events). The possibilities start to multiply. For more information, see topic, Events.

Setting the Rotation Point

The object's rotation point is determined by the Movie Symbol's registration point. For information on moving the registration point, see topic, Setting/Moving Object Registration Point.

3D Rotation

It is also possible to rotate an object around its x, y or z axis. For more information, see topic, Rotating in 3D Space.

 

Contribute Ad