O'Reilly logo

Actionscript Cookbook by Joey Lott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.2. Positioning Form Elements

Problem

You want to programmatically position form elements.

Solution

Set the _x and _y properties of each element.

Discussion

Components are derived from movie clips, so they support the basic movie clip properties and methods, including the _x and _y properties. You can set the _x and _y properties of any component to position it on stage, just as you would with a movie clip:

myComponentInstance._x = 90;
myComponentInstance._y = 180;

See Also

For more complex positioning, see Recipe 11.8 and Recipe 11.22

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required