hi sudhi var j:int = 0; for(var i:int = 0;i<startCmpId.numChildren;i++) { obj = startCmpId.getChildAt(i); j += obj.numChildren; } Alert.show("Total childrens"+j);
based on this u can implement ur logic Thanks & Regards, Srinivas. On Thu, Jan 22, 2009 at 5:42 PM, sudhi <forsu...@gmail.com> wrote: > > Dear all, > I have a main component which has so many components as its children. > then these children has children within their selves. > So all together i have deeply nested components(4 levels). > > All components are extended from Sprite. > > i want to count the number of children under the main component. > how can i do it without explicitly counting the children in each child > component. > Can i use loops. > > I tried > > component.getChildAt(0).numChildren > > but the above line gives an error > > 1119: Access of possibly undefined property numChildren through a > reference with static type flash.display:DisplayObject. > > If i cant use loops i have to write explicitly aroun d 800 extra lines > of code. > So please help me with this problem > > Thanks in advance > > Regards > Sudhi > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_india@googlegroups.com To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---