Ciao a tutti un aiuto...
devo creare una movie con all'interno 8 campi di testo dinamici
es.
testo1 - testo2 - testo3 - testo4 - testo5 - testo6 - testo7 - testo8
ogni campo di questi dovrà caricare le varianili dal file xml
<?xml version="1.0" encampo3ding="UTF-8" ?>
<eniter box="PVB261" totale="16">
<step nome="NOME" colore="0xffffff" campo3="STATO" campo4="DESCRIZIONE" campo5="DATA INIZIO" campo6="ORA INIZIO" campo7="DATA FINE" campo8="ORA FINE" campo9="DURATA"/>
</eniter>
dove totale="16" deve contare i campi di testo ripetuti quindi dovrei avere 16 righe come l'esempio sopra.
e dove colore="0xffffff" decide il colore di sfondo del campo nome="NOME".
ho provato ad impostare l'actionscripts ma ho problemi... mi potete dare una mano?
mio_xml = new XML();
mio_xml.ignoreWhite = true;
nodo = this.firstChild.childNodes;
mio_xml.onLoad = function(success) {
if (success) {
nodo = mio_xml.firstChild.childNodes;
for (i=0; i<mio_xml.childNodes[0].attributes.totale; i++) {
_root.attachMovie("puls", "puls"+i, i);
_root["puls"+i]._y = i*32;
_root["puls"+i].nome.text = nodo[i].attributes.nome;
_root["puls"+i].nome._x = 300;
_root["puls"+i].campo3.text = nodo[i].attributes.campo3;
_root["puls"+i].campo3._x = 100;
_root["puls"+i].campo4.text = nodo[i].attributes.campo4;
_root["puls"+i].campo4._x = 175;
_root["puls"+i].campo4._width = 340;
_root["puls"+i].campo5.text = nodo[i].attributes.campo5;
_root["puls"+i].campo5._x = 530;
_root["puls"+i].campo6.text = nodo[i].attributes.campo6;
_root["puls"+i].campo6._x = 630;
_root["puls"+i].campo7.text = nodo[i].attributes.campo7;
_root["puls"+i].campo7._x = 710;
_root["puls"+i].campo8.text = nodo[i].attributes.campo8;
_root["puls"+i].campo8._x = 800;
_root["puls"+i].campo9.text = nodo[i].attributes.campo9;
_root["puls"+i].campo9._x = 870;
colore = new Color(_root["puls"+i].mc);
colore.setRGB(nodo[i].attributes.colore);
_root["puls"+i].mc._width = 158;
}
} else {
this.path.testo = "caricamento errato";
}
};
mio_xml.load("pvb261.xml");
stop();
come vedete non ho potuto usare campi di testo dinamici.. cosa che mi puo tornare utile per la formattazione dei caratteri che vado a stampare nel movie. E la cosa piu difficile è che in questo modo mi crea delle righe di testo, che non posso gestire.