Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
Like this article? We recommend

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:

  1. With the timeline and Actions panel both visible, select frame 1 of the actions layer.
  2. Click the insertion point inside the Actions panel and then type the following code:
    star_mc.x = 275;
  3. Test the movie. The star clip should appear in the horizontal center of the stage.
  4. Now let's change a few other properties of the star.
  5. Add the following lines below the code inserted in step 2:
    star_mc.rotation = 90;
    star_mc.alpha = .5;
  6. 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).

  • + Share This
  • 🔖 Save To Your Account