Recipe 11.2 Positioning Form Elements

11.2.1 Problem

You want to programmatically position form elements.

11.2.2 Solution

Set the _x and _y properties of each element.

11.2.3 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;

11.2.4 See Also

For more complex positioning, see Recipe 11.8 and Recipe 11.22



ActionScript Cookbook
ActionScript 3.0 Cookbook: Solutions for Flash Platform and Flex Application Developers
ISBN: 0596526954
EAN: 2147483647
Year: 2005
Pages: 425

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net