I want to accomplish the same thing with code that Flash’s Align – Align Bottom Edge button does within the IDE. I have a series of move clips of different heights which are all added to the stage dynamically via XML. When they are all added, I want to then align them – does flash provide a method for doing this with code? Or is the only way to do it to detect their heights and adjust them by the height difference?
Share
That functionality is not present in the base ActionScript classes. You only have height, width, x, y, z properties in DisplayObject, Shape, MovieClip, etc.
The Flex framework offers advanced layout functions (horizontal and vertical align in the BasicLayout, as well as top/bottom/right/left positioning constraints). There might be other lightweight frameworks that offer this functionality (“coordy” by someRandomDude comes to mind: http://somerandomdude.com/work/coordy/)