ciao a tutti,
Nega scusa per il titolo ma non sapevo che mettere![]()
allora non capisco perchè cosi và
se inserisco un semplica controllo non và più o meglio nel trace mi dà undefinedcodice:search.onRelease = function() { trace(_global.pathfile); trace(_global.cercapath); myDfor = new LoadVars(); myDfor.cercaP = cercaP.text; myDfor.onLoad = function(success) { trace(this.totale); var totale:Number = Number; var myArrayP:Array = new Array(); for (i=1; i<=this.totale; i++) { myArrayP[i] = new Object(); myArrayP[i]["nIDProdotto"] = _root.myDfor["IDProdotto"+i]; myArrayP[i]["nProdotto"] = _root.myDfor["Prodotto"+i]; myArrayP[i]["nDescrizione"] = _root.myDfor["Descrizione"+i]; myArrayP[i]["nIDFornitore"] = _root.myDfor["IDFornitore"+i]; myArrayP[i]["nquantit"] = _root.myDfor["quantit"+i]; myArrayP[i]["nPrezzo"] = _root.myDfor["Prezzo"+i]; myArrayP[i]["nCategoria"] = _root.myDfor["Categoria"+i]; myArrayP[i]["ndataodiernap"] = _root.myDfor["dataodiernap"+i]; myArrayP[i]["ncapacita"] = _root.myDfor["capacita"+i]; myArrayP[i]["nmarca"] = _root.myDfor["marca"+i]; myArrayP[i]["ncodProdotto"] = _root.myDfor["codProdotto"+i]; myArrayP[i]["ngestore"] = _root.myDfor["gestore"+i]; } }; trace(_global.cercapath); myDfor.sendAndLoad(_global.cercapath, myDfor, "GET"); }; stop();
le variabili _global nel secondo caso rimangono vuotecodice:search.onRelease = function() { trace(_global.pathfile); trace(_global.cercapath); myDfor = new LoadVars(); myDfor.cercaP = cercaP.text; myDfor.onLoad = function(success) { trace(this.totale); var totale:Number = Number; if (this.totale == 0) { Alert.show("Non ci sono prodotti", "ATTENZIONE!!", Alert.OK, _parent, null, "alert_ico"); } else if (this.totale>0) { var myArrayP:Array = new Array(); for (i=1; i<=this.totale; i++) { myArrayP[i] = new Object(); myArrayP[i]["nIDProdotto"] = _root.myDfor["IDProdotto"+i]; myArrayP[i]["nProdotto"] = _root.myDfor["Prodotto"+i]; myArrayP[i]["nDescrizione"] = _root.myDfor["Descrizione"+i]; myArrayP[i]["nIDFornitore"] = _root.myDfor["IDFornitore"+i]; myArrayP[i]["nquantit"] = _root.myDfor["quantit"+i]; myArrayP[i]["nPrezzo"] = _root.myDfor["Prezzo"+i]; myArrayP[i]["nCategoria"] = _root.myDfor["Categoria"+i]; myArrayP[i]["ndataodiernap"] = _root.myDfor["dataodiernap"+i]; myArrayP[i]["ncapacita"] = _root.myDfor["capacita"+i]; myArrayP[i]["nmarca"] = _root.myDfor["marca"+i]; myArrayP[i]["ncodProdotto"] = _root.myDfor["codProdotto"+i]; myArrayP[i]["ngestore"] = _root.myDfor["gestore"+i]; } } trace(_global.cercapath); myDfor.sendAndLoad(_global.cercapath, myDfor, "GET"); }; }; stop();

Rispondi quotando