- Changing a Property Value
- Changing Position
- Increasing or Decreasing a Property's Value
Changing Position
The following procedure shows how to change the horizontal position of a MovieClip called star_mc, which displays a simple five-pointed star:
- With the timeline and Actions panel both visible, select frame 1 of the actions layer.
- Click the insertion point inside the Actions panel and then type the following code:
star_mc.x = 275;
- Test the movie. The star clip should appear in the horizontal center of the stage.
- Now let's change a few other properties of the star.
- Add the following lines below the code inserted in step 2:
star_mc.rotation = 90; star_mc.alpha = .5;
- Test the movie. The star should appear rotated and 50% transparent.
Transparency—and most values that are measured in percentages—usually ranges between 0 and 1 in ActionScript 3.0, rather than 0 to 100. The scaleX and scaleY properties follow this rule: A scale value of 1 means that the object is set to 100% of its original size; a scale value of 2 is 200% (twice the size) and a value of .5 is 50% (half the original size).