[flexcoders] Is it possible to put a custom component inside itself?

2008-08-04 Thread Amy
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

Re: [flexcoders] Is it possible to put a custom component inside itself?

2008-08-04 Thread Daniel Gold
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