开发者

how to deselect all Radio Button in Radio ButtonGroup on button click in flash as3?

开发者 https://www.devze.com 2023-03-04 21:30 出处:网络
how to deselect all Radio Bu开发者_如何学JAVAtton in Radio Button Group on button click in flash as3?loop on all button and unselect in a nutsheel you have to do something like this

how to deselect all Radio Bu开发者_如何学JAVAtton in Radio Button Group on button click in flash as3?


loop on all button and unselect in a nutsheel you have to do something like this

var nbChildren = myDisplayObjectContainer.numchildren;

for(var i:int = 0 ; i < nbChildren ; i++){
 if( myDisplayObjectContainer.getChildAt(i) is RadioButton )
 {
  var radioButton:RadioButton = myDisplayObjectContainer.getChildAt(i); as RadioButton;
  radioButton.select = false;
 }
}

Of course you have to use correct type instead of : RadioButton and your select/unselect method

0

精彩评论

暂无评论...
验证码 换一张
取 消