Salve ragazzi
osservate questo link:
http://www.theinvaders.it/serp/inizio.html
cliccate su qualsiasi icone e fate un giro completo delle foto, dall'inizio alla fine, per tornare all'inizio nuovamente! Un giro completo insomma!!.....
Noterete che a fine giro, ogni set di foto lascia uno scatto vuoto come se non beccasse l'immagine dentro la cartellina
la gallery è strutturata cosi:
da un menu carico i vari file swf che sono le varie gallery ! appena caricato l'swf legge un file txt con il numero totale e il nome del file da caricare lo mette in un array ed esegue l'azione dei tastini !(nex) (prev)
..ho fatto proprio il riassunto.....![]()
questo è il codice di uno dei file swf esterni che carico:
//APLHA DELLA FOTO CARICATA
MovieClip.prototype.Alpha = function(fadeIn, val, Num, snd, volume, fnc, arg)
{
var clp = this;
clp.Sund = new Sound(clp);
clp.Sund.attachSound(snd);
clp.Sund.setVolume(volume);
clp.Sund.start(0, 1);
clp.onEnterFrame = function()
{
if(fadeIn)
{
clp._alpha = clp._alpha + Num;
if(clp._alpha >= val)
{
clp.onEnterFrame = undefined;
clp._alpha = val;
fnc(arg);
}
}else{
clp._alpha = clp._alpha - Num;
if(clp._alpha <= val)
{
clp.onEnterFrame = undefined;
clp._alpha = val;
fnc(arg);
}
}
};
};
//PRELOAD
function Preload(Num)
{
_root.attachMovie("Prl", "Prl_", 6000);
_root.Prl_._x = 0;//qui metti la coordinata _x che vuoi
_root.Prl_._y = 0;//qui metti la coordinata _y che vuoi
_root.targetClip._alpha = 0;
_root.targetClip.loadMovie(myArray[Num]);
_root.Prl_.onEnterFrame = function()
{
byl = _root.targetClip.getBytesLoaded();
byt = _root.targetClip.getBytesTotal();
if(byt > 10)
{
perc = Math.round(byl * 100 / byt);
_root.prl.percentuale.text = perc;
if(byl >= byt)
{
_root.targetClip.Alpha(true, 100, 20, "", "", "", "");
_root.testo.text = myArrayTesti[Num];
this.onEnterFrame = undefined;
this.removeMovieClip();
}
}
};
}
//QUESTA è LA PARTE DI CODICE INTERESSATA
var myArray = new Array();
var myArrayTesti = new Array();
var myVars = new LoadVars();
var index = 0;
myVars.onLoad = function(success)
{
if (success)
{
for (i=1; i<=this.tot; i++)
{
l = i-1;
myArray[l] = "imgcit/"+this["img"+i];
myArrayTesti[l] = this["testo" + i];
}
_root.Preload(index);
indietro.onRelease = function()
{this.gotoAndPlay(1);
if (index > 0)
{
index--;
_root.targetClip.Alpha(false, 0, 20, "", "", _root.Preload, index);
} else {
index = myArray.length-1;
_root.targetClip.Alpha(false, 0, 20, "", "", _root.Preload, index);
}
};
avanti.onRelease = function()
{this.gotoAndPlay(1);
if (index < myArray.length)
{
index++;
_root.targetClip.Alpha(false, 0, 20, "", "", _root.Preload, index);
} else {
index = 0;
_root.targetClip.Alpha(false, 0, 20, "", "", _root.Preload, index);
}
};
}
};
//QUI CARICA IL FILE TXT
myVars.load("gallerycit.txt?var="+random(9999));
nota. QUESTO PROBLEMA LO FA SOLO CON IL TASTO NEXT>> E NON COL IL PREV<<
![]()