1. Home
  2. Computing & Technology
  3. Animation

Animating with ActionScripts

By , About.com Guide

3 of 7

Now, switching to Expert Mode, we’ll add the code that tells Flash how to position the movie clip when it loads:

onClipEvent (load){
this._x = 10;
}

_x is the horizontal position of the object, counted in ascending pixels from the left edge of the stage. So what we’ve just told Flash is that when the movie loads, it needs to take the current movie clip--referred to as this, thus pointing Flash to the symbol that the ActionScripts are assigned to--and set its horizontal position so that its center point is 10 pixels from the left edge of the stage. It’s like Cartesian coordinates, when graphing on a plane using (x,y). We’ve just set x as 10.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Animating with ActionScripts

©2009 About.com, a part of The New York Times Company.

All rights reserved.