Salve a tutti,
ho un quesito da porvi:
in un file txt ho delle variabili che vorrei passare ad un array,ma nn so come fare! mi potete aiutare?
Salve a tutti,
ho un quesito da porvi:
in un file txt ho delle variabili che vorrei passare ad un array,ma nn so come fare! mi potete aiutare?
:mavieni:
a viene in mente una cosa del genere:
codice:lv = new LoadVars(); variabili = new Array(); lv.load("file.txt"); lv.onLoad = function() { for (var x in this) { if (typeof this[x] == "string") { variabili.push(this[x]); } } };
Ciao Lanny xchè
codice:lv = new LoadVars(); variabili = new Array(); lv.load("loadvar.txt"); lv.onLoad = function() { for (var x in this) { if (typeof this[x] == "string") { variabili.push(this[x]) trace(variabili[x]) } } };
mi da undefined
nel txt ho inserito
&data=01/01/2004&orario=10.00&attivita=Riunione Team&
Grazie
Flash MX Esempi da scaricare -
Team www.BeatFly.com - render,photo,ecc.. Elements01.net - Beat Fly official Blog-
variabili sarà un array di questo tipo:Originariamente inviato da rempox
Ciao Lenny xchè
codice:lv = new LoadVars(); variabili = new Array(); lv.load("loadvar.txt"); lv.onLoad = function() { for (var x in this) { if (typeof this[x] == "string") { variabili.push(this[x]) trace(variabili[x]) } } };
mi da undefined
nel txt ho inserito
&data=01/01/2004&orario=10.00&attivita=Riunione Team&
Grazie
variabili[1]="01/01/2004";
variabili[2]="10.00";
variabili[3]="Riunione Team";
x assume i valori:
data
orario
attivita
quindi:
variabili["data"] è undefined
variabili["orario"] è undefined
variabili["attivita"] è undefined
Grazie finalmente una spiegazione chiara.
Ciao Le nny![]()
Flash MX Esempi da scaricare -
Team www.BeatFly.com - render,photo,ecc.. Elements01.net - Beat Fly official Blog-