On 6/19/05, Ghislain Simard <[EMAIL PROTECTED]> wrote: > How to generate dynamically the nodes in a Tree using the label > attributes from viewStack containers' labels?
> <mx:Tree dataProvider="myViewStacks"/> > > <mx:ViewStack id="myViewStacks"> [...] So you're looking for something like the following, except that you want a Tree instead of a LinkBar. <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"> <mx:ViewStack id="vs"> <mx:Box label="Box 1"><mx:TextInput /></mx:Box> <mx:Box label="Box 2"><mx:TextInput /></mx:Box> <mx:Box label="Box 3"><mx:TextInput /></mx:Box> </mx:ViewStack> <mx:LinkBar id="lb" dataProvider="vs" /> </mx:Application> The way the LinkBar (and TabBar) works is, it iterates over the children of the target ViewStack and creates a Link object for each child. It also listens for changes to the target ViewStack by listening for the "childCreated" and "childDestroyed" events. Would it be better if UIObject implemented the TreeDataProvider interface? That way you could do something like this without writing any code: <!-- shows all objects in application --> <mx:Tree dataProvider="mx.core.Application.application" /> I haven't thought about performance issues though. Manish Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> 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/

