Set x,y Coordinates with ActionScript


You need to know the instance name of a MovieClip to modify it's properties (like (x,y) position) with ActionScript. Code cannot be compiled if it contains an error.

What We Did

  1. Created an actions layer
  2. Set the X position of ball1 with ActionScript
  3. Set the X and Y positions of ball2 with ActionScript
  4. Created a compiler error by referencing a MovieClip that doesn't exist

Important ActionScript

ball1.x = 100;

Self-Check for Understanding

Create ActionScript to position the MovieClip in the following example at (100,250):

Click Here for the Answer