You could use an HBox with a negative horizontalGap. - Gordon
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Andriy Panas Sent: Monday, August 28, 2006 2:19 PM To: [email protected] Subject: [flexcomponents] What is the best approach to create a custom container that will allow its children to be overlapped? Hello flexcomponents, THE IMAGINARY TASK: Display a stack of playing cards in Flex when every card overlaps with its neighbors. The list of the cards is fetched from the list-based data provider. The Z-order of cards will be controlled by setting in AS3: container.setChildIndex(myCard, container.numChildren-1); ------------------------------------------------- Many class containers that are shipped with Flex 2 UI framework (HBox, VBox, TileList) do not allow its children to be overlapped. Currently I can think of two approaches: -------------------------------------------------------- a) Use <mx:Canvas> container and attach all content dynamically to this container in a cycle via "addChild" operand and LAYOUT it via applying custom layout rules. Disadvantages: This approach is not reusable in various parts of the application and projects, also the declarative power of MXML is not used. Advantages : Works with list-based data provider via ActionScript -------------------------------------------------------- b) Create a custom container via extending <mx:Canvas> container. Use it in combination with data-driven MXML component. Override "updateDisplayList" method with new custom layouting rules that allow container children to be overlapped. Advantages : Reusable сontainer, works with list-based data provider via MXML. Disadvantages: Everytime when any from <mx:Repeater> children change its Z-order, the <mx:Repeater> resorts its children in order to display its children starting from lowest Z-order rank to highest which renders the usage of <mx:Repeater> not usable in my task. -- Best regards, Andriy mailto:[EMAIL PROTECTED] Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcomponents/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
