Ciao a tutti/e, ho una funzione che scorre un array pescato da un XML.
Perché quando assegno a linktosite1 (un movieclip sullo stage) il valore di link[p] della prima e seconda immagine hanno il valore di link[p] della 3 immagine?Codice PHP:function nextImage() {
if (p<(total-1)) {
p++;
} else {
p = 0;
}
if (loaded == filesize) {
picture1._alpha = 0;
picture1.loadMovie(image[p], 1);
desc_txt1.text = description[p];
price_txt1.text = "€ " + price[p];
discount_txt1.text = discount[p];
trace(p + " " + link[p]); // [COLOR=limegreen]QUESTO TRACCIA CORRETTAMENTE[/COLOR]
linktosite1.onRelease = function(){
//getURL(link[p]);
trace(p + " " + link[p]); // [COLOR=red]QUESTO NON TRACCIA CORRETTAMENTE[/COLOR]
}
}
if (p<(total-1)) {
p++;
} else {
p = 0;
}
if (loaded == filesize) {
picture2._alpha = 0;
picture2.loadMovie(image[p], 1);
desc_txt2.text = description[p];
price_txt2.text = "€ " + price[p];
discount_txt2.text = discount[p];
trace(p + " " + link[p]); // [COLOR=limegreen]QUESTO TRACCIA CORRETTAMENTE[/COLOR]
linktosite2.onRelease = function(){
//getURL(link[p]);
trace(p + " " + link[p]); // [COLOR=red]QUESTO NON TRACCIA CORRETTAMENTE[/COLOR]
}
}
if (p<(total-1)) {
p++;
} else {
p = 0;
}
if (loaded == filesize) {
picture3._alpha = 0;
picture3.loadMovie(image[p], 1);
desc_txt3.text = description[p];
price_txt3.text = "€ " + price[p];
discount_txt3.text = discount[p];
trace(p + " " + link[p]); // [COLOR=limegreen]QUESTO TRACCIA CORRETTAMENTE[/COLOR]
linktosite3.onRelease = function(){
//getURL(link[p]);
trace(p + " " + link[p]); // [COLOR=red]QUESTO NON TRACCIA CORRETTAMENTE[/COLOR]
}
}
}
![]()

Rispondi quotando