Sure, as long as you hit your base case and the constructor actually returns for the last one you create you'll be fine. Just to test and prove the logic to yourself, create a static class variable and decrement it each time you create a new one, check it in the constructor if its > 0 declare a new instance and that will be your base case. You should have a hierarchical component where each instance has one child, that has a child....with a depth equal to whatever your static var was initialized to.
On Mon, Aug 4, 2008 at 2:51 PM, Amy <[EMAIL PROTECTED]> wrote: > Hi, all; > > I want to create a component that is recursive, but I'm not sure > whether it's possible to create an instance of a component inside the > definition of that component. Does anyone have any examples of doing > recursion in a Flex component? > > I started out trying to modify RandomWalk, but it looks like I'd have > to change a lot of logic in a lot of places to get it to work (plus it > isn't truly recursive), and my time frame is too short for trying to > root through and find everything I'd need to change. > > Thanks; > > Amy > > >

