codice:var list_obj:Object = new Object(); list_obj.change = function(eventObj:Object) { myDfor = new LoadVars(); myDfor.cerca = eventObj.target.selectedItem.data; myDfor.onLoad = function(success) { if (success) { trace(this.totale + "prodotto" + eventObj.target.selectedItem.data); var myArrayP:Array = new Array(); for (i = 1; i <= this.totale; i++) { myArrayP[i] = new Object(); myArrayP[i]["nprodotto"] = _root.myDfor["prodotto" + eventObj.target.selectedItem.data]; myArrayP[i]["nid"] = _root.myDfor["id" + eventObj.target.selectedItem.data]; myArrayP[i]["nDescrizioneProdotto"] = _root.myDfor["DescrizioneProdotto" + eventObj.target.selectedItem.data]; myArrayP[i]["nPrezzoUnitario"] = _root.myDfor["PrezzoUnitario" + eventObj.target.selectedItem.data]; myArrayP[i]["nquantit"] = _root.myDfor["quantit" + eventObj.target.selectedItem.data]; _root.descrizione.text = myArrayP[i]["nDescrizioneProdotto"]; _root.prezzo.text = myArrayP[i]["nPrezzoUnitario"]; _root.quantitMagazzino.text = "Disponibilità attuale del magazzino: " + myArrayP[i]["nquantit"]; _root.maximun = myArrayP[i]["nquantit"]; trace("[" + i + "]" + myArrayP[i]["nprodotto"] + " id " + myArrayP[i]["nid"] + " PrezzoUnitario " + myArrayP[i]["nPrezzoUnitario"] + " Descrizione Prodotto " + myArrayP[i]["nDescrizioneProdotto"]); trace(maximun); } } }; myDfor.sendAndLoad("http://localhost/search/dettegliolistaProdotto.php", myDfor, "GET"); quantitB.visible = 1; inserimento.visible = 1; annulla.visible = 1; descrizione.visible = 1; myDF.visible = 1; quantitB.maximum = _root.maximun; quantitB.oldkillfocus = quantitB.onkillfocus; quantitB.onKillFocus = function() { var n:Number = Number(this.inputField.text); this.oldKillFocus(); if (n > this.maximum) { Alert.show("Il valore massimo impostabile è " + this.maximum, "Attenzione!", Alert.OK); } }; }; listap.addEventListener("change", list_obj);