/**
Requiert :
- Composant RadioButton dans la bibliothèque
*/
import mx.controls.RadioButton;
this.createClassObject(RadioButton, "first_rb", 10, {label:"first", groupName:"radioGroup"});
this.createClassObject(RadioButton, "second_rb", 20, {label:"second", groupName:"radioGroup"});
this.createClassObject(RadioButton, "third_rb", 30, {label:"third", groupName:"radioGroup"});
// Positionnement des boutons radio sur la scène.
second_rb.move(0, first_rb.y + first_rb.height);
third_rb.move(0, second_rb.y + second_rb.height);
// Création d'un objet écouteur.
var rbListener:Object = new Object();
rbListener.click = function(evt_obj:Object){
trace("The selected radio instance is " + evt_obj.target.selection);
}
// Ajout de l'écouteur.
radioGroup.addEventListener("click", rbListener);
Partager