[thelist] Laying out components in Flash

Marcus Andersson marcus at bristav.se
Tue May 18 16:23:01 CDT 2004

joe wrote:

> You don't give much (any) detail about how you are instantiating any of 
> the components you're using, but when you do so you can access it's 
> properties as you would any movie clip.  A component with the instance 
> name myComp has properties like:
> myComp._x
> myComp._y
> myComp._width
> myComp._height
> so if you want to position a new instance of myNextComp relative to 
> myComp, you can calculate the latter's position and width and place the 
> former accordingly.
> you may also find some useful info by looking at the Flash Help on the 
> localToGlobal and globalToLocal methods too.

What you suggests is what I called absolute positioning and that is not what I want since it requires me to 
implement pretty extensive logic to position components relative to each other and inside, and relative to, 
parent containers. I want to do something similar as to either flow components horizontal with various 
paddings and margins or do the same on the vertical axes and place these components inside a parent container 
of some sort (if existant).

I want to do away with the traditional (traditional in Flash and VB anyway) way of placing things with pixels 
and tell the containers that you are using "column-layout" or "flow-layout" or "grid-layout" and you are using 
5px paddings and here are your components.

I want to know if there is something in Flash that allows me to do this (even if it's just a bit of the way) 
or if I have to build it all from scratch.


More information about the thelist mailing list