Hi,

Check the below code and let me know.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
      <mx:Script>
            <![CDATA[
                  import mx.controls.Alert;

                  private function findCount():void
                  {
                        var numChildVisible:int = 0;
                        for(var i:int=0;i<canvas.numChildren;i++)
                        {
                              if(canvas.getChildAt(i).visible)
                              {
                                    numChildVisible++;
                              }
                        }

                        Alert.show("total count--->"+canvas.numChildren);
                        Alert.show("visible count--->"+numChildVisible);
                        button3.visible = true;
                  }


            ]]>
      </mx:Script>
      <mx:Canvas width="50%" height="50%" id="canvas">
            <mx:Button label="Button1" click="findCount()"/>
            <mx:Button label="Button2" x="130" y="0" click="findCount()"
visible="true"/>
            <mx:Button id="button3" label="Button3" x="299" y="0"
click="findCount()" visible="false"/>
      </mx:Canvas>
</mx:Application>


Thanks&Regards,
Naveen.

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to