Depth management with a 'depth' property
Nov. 5th, 2007 | 12:08 am
I've been working on a little Flash-based UI framework for one of my clients. It's nothing big and professional, but it is somewhat inspired by Adobe Flex, with its own dynamic XML-based layout language. And no doubt we've run into some of the same issues we often find Flex developers complain about.
One such problem is the problem of depth management, arising out of the way Flash arranges objects in a container, and the way Flex layout containers like Box, Tile, etc., lay out their contents.
Consider this simple example:
<box direction="vertical" vertical-gap="-10">
<box direction="horizontal">
<button id="prevButton" />
<button id="nextButton" />
</box>
<document />
</box>
The intention here should be pretty obvious: a document with two buttons above it (for flipping pages). Here's what the output looks like:

Almost perfect -- except for the buttons getting tucked underneath the document instead of floating above it.
( Read more... )