0 Replies Latest reply on Mar 26, 2010 8:20 AM by anath123

    Unable to change component children properties in flex




      I have a component named PatientCanvas derived from Canvas



      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"







           public function showChildren():void{






           <mx:Image source="Patient.jpg" />

           <mx:Label id="patientName"/>



      Inside Application script I have a function in which I create new instance of PatientCanvas


      var pCan:PatientCanvas  = new PatientCanvas ;


      at this location I get the alert showing "2" due to the creationComplete event handler


      after this I call pCan.showChildren() which gives out alert showing "0"


      not understanding why? In previous line it had 2 children.


      I need to change the text of the label 'patientName' in pCan. But pCan has zero children hence pCan.patientName is null.