1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| //remplir la combobox
var recup:LoadVars = new LoadVars();
recup.onLoad = function(success) {
var tabgroup:Array = recup.varflash.split(",");
combo.addItem("Groupes");
for (var i = 0; i<tabgroup.length; i++) {
combo.addItem({label:tabgroup[i], data:tabgroup[i]});
}
};
recup.load("combogroupe.php","0","POST");
//faire un choix dans la combobox
var groupe:LoadVars = new LoadVars();
var obj:Object = new Object();
obj.change = function(event_obj) {
groupe.nom = event_obj.target.selectedItem.data;
groupe.sendAndLoad("rech_groupe.php",groupe,"POST");
};
//afficher les résultats dans les champs de texte dynamique
groupe.onLoad = function() {
nom_gr_fr.text = groupe.textenom;
style_gr_fr.text = groupe.textestyle;
hist_gr_fr.text = groupe.textehist;
};
combo.addEventListener("change",obj);
//Ajout dans la BDD
var ajout:LoadVars = new LoadVars();
ajout_gr_fr.onRelease = function() {
ajout.nomaj = nom.text;
ajout.styleaj = style.text;
ajout.histoireaj = histoire.text;
maj();
nom.text="";
style.text="";
histoire.text="";
ajout.sendAndLoad("ajoutgroup.php",ajout,"POST");
}
//fonction de mise à jour
function maj(){
i++;
combo.addItem({label:nom.text, data:i});
} |
Partager