questo è il codice AS all'interno del clip ZOOM dove mi vengono stampati tutti i nomi presi da XML nel clip filmato mappa_mc
Codice PHP:
var caricaXML:XML = new XML();
caricaXML.ignoreWhite = true;
caricaXML.onLoad = leggiXML;
caricaXML.load("AZIENDA.xml");
function leggiXML(succes:Boolean) {
if (succes == true) {
var nomemappa:Array = [];
var colore:Array = [];
var tempArray:Array = new Array();
var tempArray = this.firstChild.childNodes;
for (var i:Number = 0; i<tempArray.length; i++) {
tempArray[i].childNodes[0].firstChild;
nomemappa[i] = tempArray[i].childNodes[2].firstChild;
colore[i] = tempArray[i].childNodes[4].firstChild;
var maps:MovieClip = mappa_mc.duplicateMovieClip("maps"+i+"_mc", i);
maps.nomemappa = nomemappa[i];
maps.colore = colore[i];
color=colore[i];
maps.nomemap_txt.text ="* " + nomemappa[i];
maps.quad_txt.text ="*";
maps.nomesmal_txt.text ="* " + nomemappa[i];
formato = new TextFormat()
formato.size = 6
formato_due = new TextFormat()
formato_due.size = 18
formato_due.color = "0x" + color
formato_tre = new TextFormat()
formato_tre.size = 2.5
maps.nomemap_txt.setTextFormat(formato);
maps.quad_txt.setTextFormat(formato_due);
maps.nomesmal_txt.setTextFormat(formato_tre);
maps.nomemap_txt._alpha= 0;
maps.quad_txt._alpha= 100;
maps.nomesmal_txt._alpha= 0;
}
} else {
trace("file non trovato!");
}
}
mentre questo è nel clip contenuto e mi stampa l'elenco dei titoli che, cliccandoli, mi devono effettuare il cambiamento ai campi del clip maps:
Codice PHP:
var caricaXML:XML = new XML();
caricaXML.ignoreWhite = true;
caricaXML.onLoad = leggiXML;
caricaXML.load("AZIENDA.xml");
function leggiXML(succes:Boolean) {
if (succes == true) {
var titolo:Array = [];
var tempArray:Array = new Array();
var tempArray = this.firstChild.childNodes;
for (var i:Number = 0; i<tempArray.length; i++) {
titolo[i] = tempArray[i].childNodes[1].firstChild;
var item:MovieClip = news.duplicateMovieClip("elemento"+i+"_mc", i);
item.news_txt.htmlText = titolo[i];
item.onRelease = function() {
_root.zoom.maps.nomemap_txt._alpha= 100;
_root.zoom.maps.quad_txt._alpha= 0;
};
}
} else {
trace("file non trovato!");
}
}