• User Newbie

    creare automaticamente delle variabili

    ho un problema, dovrei caricare delle variabili nel xml in automatico solo che non riesco a capire come posso modificare il codice AS2.

    questo codice, riportato sotto, dopo aver riempito dei textinput e aver trovato una associazione con l'xml mi estrae dei dati il problema è che l'xml viene cambiato spesso (le variabili al suo interno) e sono costretto a modificare questa parte di codice.
    [html]for (var i = 0; i < nodes.length; i++)
    {
    var Riga01 = nodes*.attributes.Nome_File;
    var Riga02 = nodes*.attributes.Data_Documento;
    var Riga03 = nodes*.attributes.Numero_Polizza;
    var Riga04 = nodes*.attributes.Descrizione;
    var Riga05 = nodes*.attributes.Targa;
    var Riga06 = nodes*.attributes.CodFisc_PIva;
    var Riga07 = nodes*.attributes.Telefono;
    var Riga08 = nodes*.attributes.Cognome;
    var Riga09 = nodes*.attributes.Nome;
    var Riga10 = nodes*.attributes.Importo;

    if(Riga01.toLowerCase().indexOf(_root.stringa.toLowerCase())!=-1)
    if(Riga02.toLowerCase().indexOf(_root.stringa2.toLowerCase())!=-1)
    if(Riga03.toLowerCase().indexOf(_root.stringa3.toLowerCase())!=-1)
    if(Riga04.toLowerCase().indexOf(_root.stringa4.toLowerCase())!=-1)
    if(Riga05.toLowerCase().indexOf(_root.stringa5.toLowerCase())!=-1)
    if(Riga06.toLowerCase().indexOf(_root.stringa6.toLowerCase())!=-1)
    if(Riga07.toLowerCase().indexOf(_root.stringa7.toLowerCase())!=-1)
    if(Riga08.toLowerCase().indexOf(_root.stringa8.toLowerCase())!=-1)
    if(Riga09.toLowerCase().indexOf(_root.stringa9.toLowerCase())!=-1)
    if(Riga10.toLowerCase().indexOf(_root.stringa10.toLowerCase())!=-1){

    risultati.htmlText += "<b><font color='#666666'>Nome File : </font></b><a href='" + Riga01 + "'><b><font color='#0000ff'><u>" + Riga01 + "</u></font></b></a>\n<b><font color='#666666'>Data Documento : </font></b>" + Riga02 + "\n<b><font color='#666666'>Numero Documento : </font></b>" + Riga03 + "\n<b><font color='#666666'>Descrizione : </font></b>" + Riga04 + "\n<b><font color='#666666'>Targa : </font></b>" + Riga05 + "\n<b><font color='#666666'>Cod.Fisc P.Iva : </font></b>" + Riga06 + "\n<b><font color='#666666'>Telefono : </font></b>" + Riga07 + "\n<b><font color='#666666'>Cognome : </font></b>" + Riga08 + "\n<b><font color='#666666'>Nome : </font></b>" + Riga09 + "\n<b><font color='#666666'>Importo : </font></b>" + Riga10 +"\n ";
    [/html]

    ho fatto qualche tentativo modificando con questo

    for (var each in nodes*.attributes){
    this[each] = nodes*.attributes[each];
    }

    ma continuo ad avere l'errore

    qualcuno potrebbe aiutarmi a modificare il codice??

    grazie