questo è quello che compare nel primo frame del livello action
codice:
stop();
Stage.showMenu = false;
Stage.scaleMode = 'noScale';
System.useCodepage = true;
file = 'http://www.panoramaimmobiliare.com/annunci.php';
news = new LoadVars();
news.onLoad = function(success){
if(success){
play();
}
}
news.load(file);
alpha = 100;
i = 0;
j= 1;
function time(a){
fade = setInterval(a, 20);
}
function fadeIn(){
if(alpha == 0){
clearInterval(fade);
play();
}
else{
alpha -= 1;
mask1._alpha = alpha;
}
}
function fadeOut(){
if(alpha == 100){
clearInterval(fade);
gotoAndPlay(2);
}
else{
alpha += 1;
mask1._alpha = alpha;
}
}
questo invece è quello che fa il lavoro e compare nel secondo frame del livello action
codice:
stop();
function News(){
if(i == news.totNews){
i = 0;
}
if(j == 3){
j = 1;
}
this.onEnterFrame=function()
{
if (this.r1.getBytesLoaded()>0 && this.r1.getBytesLoaded() >= this.r1.getBytesTotal())
{
r1._width= 150;
r1._height = 110;
//this.r1.larg = this.r1._width;
//this.r1.alt = this.r1._height;
//dimensiona(this.r1.larg, this.r1.alt);
//delete this.onEnterFrame;
}
}
loadMovie(news["url"+i],r1);
trace("controllo su j : " + j);
trace("controllo del movielcip : " + this["r"+j]);
txtNews1.html = true;
txtNews1.htmlText = ""+news["data"+i]+"
";
txtNews1.htmlText += ''+news["titolo"+i]+'
';
txtNews1.htmlText += ''+news["immobile"+i]+'
';
txtNews1.htmlText += news["testo"+i];
i++;
j++;
}
News();
time(fadeIn);
COME VEDI NON CI SONO CICLI SE INTENDI CICLI ITERATIVI