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
Post a Comment