views:

19

answers:

0

Inside of accordion panel, we have some containers like canvas,vbox etc. within that containers have some components like button,link button etc. How to raise events for button and link buttons using addeventListener

 ` <mx:Accordion width="100%" height="100%" id="crmEntities" >
       <mx:Canvas id="CompanyView" label="Company" width="100%" >
            <mx:Button  id="companyButton" styleName="storeButtonBar" label="Company      Details" paddingLeft="20" height="25" width="100%" useHandCursor="true" textAlign="left"/> 
        </mx:Canvas>
   </mx:Accordion>


 private function init() : void 
            { 
companyButton.addEventListener(MouseEvent.CLICK,CompanyButtonClicked);
}
`

we call init() on mxml creationcomplete property but we didn't get 'CompanyButtonClicked'
function on that runtime . Suppose it's has more number of buttons on the canves some buttons only worked . So what is problem . What did i wrong ?