positioning display objects in a container - what's wrong with this code?

Hi Greg,

I can’t really provide specifics for your project, but I find that using the “contentBounds” properties + anchor points is useful when aligning one edge of an object with the edge of another object, i.e. aligning the top of one rectangle with the bottom of another one. As for containers, perhaps you’ll need to just calculate the bounds when you create it, stored in a local variable, and use that to align other objects around (and then nil out the variable if it’s no longer needed).

Brent

@Brent Thanks for that link it gave me more insight into why sometimes I am unable to determine logically how things get positioned.

I am little confused about the anchorClidren on groups though. I distinctly remember when reading about groups and containers when G2 came out that unless you set anchorChildren to true on a group the objects in it will not move when changing position of the group.

Now that I’ve read the guide in your link it seems that only anchor points are not respected when it’s false.

I think this was the origin of my troubles.

Sorry to hijack the thread.

thanks guys - there is one remaining aspect of my questions re resize for the scroll view - I’ve broken this out to a specific post at:  http://forums.coronalabs.com/topic/44938-newscrollview-does-it-support-resizing-for-orientation-changes-within-storyboardcomposer/