Questo un esempio per verificare la gestione di un check box
codice:
checkBox1.setEnabled(true);// abilita false disabilita
checkBox1.setLabel("Send more information");
checkBox1.setValue(false);
msg1="Stato = "+ checkBox1.getEnabled()
msg2="Valore = "+ checkBox1.getValue()
trace(checkBox1.getEnabled()); //ritorna lo stato
trace(checkBox1.getValue()); //ritorna il valore
myObject = new Object();
myObject.myHandler = function(component){
if(checkBox1.getValue()){
msg3=component._name + " has been selected "
trace(component._name + " has been selected ");
}else{
msg3=component._name + " has been DE-selected "
trace(component._name + " has been DE-selected ")
}
}
checkBox1.setChangeHandler("myHandler", myObject);
quindi a te basta
checkBox1.getValue()
io però utilizzo
codice:
send_btn.onPress=function(){
variabili = new LoadVars()
variabili.campo1=nome
variabili.campo2=cognome
variabili.campo3=checkBox1.getValue()
variabili.onLodad=function(success){
if(success){
if(this.risposta=="ok"){
trace("dati inviati correttamente"
}else{
trace("dati non perventuti al PHP")
}
}
variabili.sendAndLoad("pagina.php", variabili, "POST")
}
Ciao