<A HREF="/Tech" TARGET="_self"><IMG SRC="FT-Logo.gif" WIDTH=137 HEIGHT=70 BORDER=0></A>
Actionscript - Set Properties

In addition to regular actions there are 11 properties that you can set in a button or a frame. They refer to a movie clip by it's instance name, to all the objects in a frame, or to a global value that pertains to the whole movie. There are also 19 different get properties that you can use to find the current values of objects in Flash with Get Property.

Each 'Set Property' action has 3 parameters that are set in the Properties Action dialog box. First, you choose the type of property from a drop down selection box, then you enter the target and the value for the property. As you add the parameters you will see the script is automatically compiled and displayed by Flash. You need to enter the complete path for the target, which is determined in the same manor as for Tell Target. If the property refers to the current frame or a global value then you leave the Target:  box empty.

To rotate a movie clip 45 degrees counterclockwise with an instance name of Bird, you will get a script as follows:

Set Property ("/Bird", Rotation) = "-45"

If you want to change the alpha transparency of all objects in a frame to 50 percent you will get the script below. This is applied as a frame action, whereas in the rotation example the action is in the button instance. Note, that the instance name is now missing, but the 2 quotes remain with nothing inside of them.

Set Property ("", Alpha) = "50"

The value of a property is based on the change from its original state and does not accumulate, so applying the same property twice will not change an object's property. Also, note how we change the settings back to their original state with the reset button.

Set Property ("", Alpha) = "100"
Set Property ("/Bird", Rotation) = "0"

<A HREF="/Tech" TARGET="_self"><IMG SRC="FT-Logo.gif" WIDTH=137 HEIGHT=70 BORDER=0></A>
Download FLA in Zip format

You can't type a complete line of script into Flash, you must allow Flash to compile it from your selection and entries in the dialog box. You can not paste script into Flash that was prepared in an external text editor. However, now Flash 4 allows you to copy and paste actions (including script) from and to the action columns inside Flash. To transfer script and actions from movie to movie, put them in a movie clip and copy it. By using this method you can build a library of scripts and actions.

Set Properties

Alpha                   Alpha Transparency Percentage
Show Focus Box          Show the Focus Box
High Quality            Sets Quality 
Name                    Instance Name
Rotation                Rotation
Sound Buffer Time       # of seconds Sound is Pre buffered
Visibility              Visibility
X Position              Horizonal X Position
X Scale                 X Scale Factor
Y Position              Vertical Y Position
Y Scale                 Y Scale Factor