Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    diverso colore per nodevalue XML

    Ciao a tutti.

    Quesito:
    Come faccio a colorare in modo differente i due nodeValue di questa struttura XML con AS:

    XML
    codice:
    <faqs>
    <faq numero="1">
    	<domanda>Domanda</domanda>
    	<risposta>Risposta</risposta>
    </faq>
    <faq numero="2">
    	<domanda>Domanda</domanda>
    	<risposta>Risposta</risposta>
    </faq>
    </faqs>
    AS
    codice:
    var nodes = this.firstChild.childNodes;
    		for (var i = 0; i<nodes.length; i++) {
    			this.path.testo += "
    ";
    			this.path.testo += "Titolo: "+nodes[i].attributes.titolo+"
    ";
    			this.path.testo += "
    ";
    			
    			for (var j = 0; j<nodes[i].childNodes.length; j++) {
    				var nodovalue0 = nodes[0].childNodes[j];
    				this.path.testo += ""+nodovalue0+"
    ";
    			}
    		}

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2004
    Messaggi
    641
    io ho fatto così:

    myTextFormat = new TextFormat();
    myTextFormat.color= 0x00ff00;
    _root.domanda.setTextFormat(myTextFormat);

    myTextFormat2 = new TextFormat();
    myTextFormat2.color= 0xffff00;
    _root.risposta.setTextFormat(myTextFormat2);


    dove domanda e risposta sono i miei campi testo.
    spero ti funzioni

    ciao

  3. #3
    Si , ma cosi devo impostare due campi dinamici. Io adesso ho un solo campo che mi pigli tutto.


  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2004
    Messaggi
    641
    e perchè non provi a fare così:

    _root.domanda.html = true;
    _root.domanda.htmlText = "<font color='#FF0000'>"+primo + "</font>"+ newline +"<font color='#00ff00'>"+ secondo+ "</font>";


    dove primo e secondo sono due variabili:
    primo = (myarray[0].childNodes[0]);
    secondo = (myarray[0].childNodes[1]);

    domanda è il mio campo che contiene il testo

  5. #5
    okey. ci prove e ti faccio sapere.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.