Object Properties

Object Properties

Flash CS4 ActionScript 3.0 Tutorial

 

How to ChangeĀ Button Symbol, Movie Symbol and Text Properties with Flash ActionScript

 

 

Often times we wish rotate, alter the alpha value, or scale an object using ActionScript. Object Properties can be altered using a single line of code.

The properties you have access to include; Alpha, Height, Location on Stage, Rotation, Scale, Visible, and Width. For information on each of the properties, see topics, Alpha Property, Height Property, Location on Stage Property, Rotation Property, Scale Property, Visible Property, and Width Property.

Tutorial Elements

Movie Symbol with instance name propMovie_mc

 

Step One

Add a Movie Symbol to the stage and click the symbol with the Selection tool.

Step Two

Open the Properties panel (Cmd/F3 (PC-Ctrl/F3)) and type in the name propMovie_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.

propMovie_mc.rotation = 90;

Step Six

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

Rotation Pivot Point

The object's pivot point is set when you create your symbol. It is called the registration point. You can also change an object's registration point by double-clicking the object and moving the object to reposition the registration point.

 

Contribute Ad