flex - Actionscript for remove button element -


how can remove button in actionscript when pass button id.

<fx:script>     <![cdata[ public function removebutton(buttonid:string):void         {             hb1.removeelementat(buttonid);         } ]]> </fx:script>    <s:hgroup id="hb1">  </s:hgroup> 

as sharpedge said, there no public function available element id, work around is:

public function removebutton(buttonid:string):void {     (var i:int = 0; < hb1.numchildren; i++)     {         var object:object = hb1.getchildat(i);          if (object.id == buttonid)         {             hb1.removeelementat(i);             break;         }     } } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -