Hallo Wanderratte,
ich habe ein kleinen Problem mit deinem Tut der Wabber Galerie.
Die Tumbs werden bei mir alle in einer Zeile dargestellt, obwohl ich es anders eingestellt habe. Habe ich irgendwo einen Fehler eingebaut?
Meine Fotos sind etwas größer und zwar 350 x 470 px, liegt es daran?
Schau mal unter
www.licht-echt.com
Hier der Code:
/*******Deklaration der Variablen*********/
//Bilderanzahl
var bAnz = 12;
//Anzahl der Bilder, die in einer Reihe angezeigt werden sollen
var nReihe = 4;
//Berechnung die Reihenanzahl
var aReihe = Math.floor(bAnz/nReihe)
//Zaehler für die Reihen
var rZaehler = aReihe;
//Fadegeschwindigkeit
var aGesch = 5;
//Ordner aus dem die Bilder ausgelesen werden, solltet ihr einen anderen Ordnernamen
//gewählt haben, dann müsst ihr ihn hier ändern
var ordner = "kids";
//Position der Thumbs, ausgelegt auf die Hoehe der Anzeigebilder von 300 PX
var yPos = 370;
var xPos = 0;
//grösse der Thumbs in PX
var tWeite = 38;
var tHoehe = 50;
//Abstand
var weite = 60;
//Bildskallierung
var skal =10;
var wMulti = .9;
/**************+Ende der Deklaration*********************/
/******* Funktionen für die Effekte *********/
function effekt(obj, wX) {
obj.onEnterFrame = function() {
this.sX = Math.ceil(Number(this.sX*wMulti)+Number((wX-this._xscale)*wMulti));
this._xscale += this.sX;
this._yscale += this.sX;
};
}
function faden(obj, wert) {
container.onEnterFrame = function() {
if (wert) {
this._alpha -= aGesch;
if (this._alpha<=1) {
wert = false;
container.bild.loadMovie(obj, 1);
}
}
else {
this._alpha += aGesch;
if (this._alpha>=99) {
delete this.onEnterFrame;
}
}
};
}
function lade(i) {
obj = "thumbs"+i;
if (i%nReihe == 0) {
--rZaehler;
}
this.createEmptyMovieClip(obj, i+10);
this[obj].createEmptyMovieClip("thumbs", 1);
this[obj].thumbs.loadMovie(ordner+"/pic"+i+".jpg");
this[obj].sX = 0;
this[obj].i = i;
this[obj].reihe = rZaehler;
this[obj].onEnterFrame = function() {
this.bytes_gesamt = this.thumbs.getBytesTotal();
this.bytes_geladen = this.thumbs.getBytesLoaded();
this.prozent = int(this.thumbs.getBytesLoaded()*100/this.thumbs.getBytesTotal());
if (this.thumbs.getBytesLoaded()>2000 && this.prozent>=100){
delete this.onEnterFrame;
ausrichten(this.i, this, this.reihe);
this.file = ordner+"/pic"+this.i+".jpg";
with (this.thumbs) {
_width = tWeite;
_height = tHoehe;
_x -= _width/2;
_y -= _height/2;
}
this._yscale = 120;
this._xscale = 120;
effekt(this, 100);
this.onRelease = function() {
faden(this.file, true);
};
this.onRollOver = function() {
effekt(this, 120);
};
this.onRollOut = function() {
effekt(this, 100);
};
}
};
}
function ausrichten(i, obj, reihe) {
if (i>nReihe) {
ber = i-nReihe*rZaehler;
obj._x = -xPos+weite*ber;
obj._y = yPos+weite*rZaehler;
} else {
obj._x = -xPos+weite*i;
obj._y = yPos;
}
}
this.createEmptyMovieClip("container",1);
this.container.createEmptyMovieClip("bild",1);
with (container) {
_x = 460;
_y = 40;
bild.loadMovie(ordner+"/pic"+1+".jpg");
}
for (var z = bAnz; z>0; --z) {
lade(z);
}
/********* Ende **************/
Viele Grüße
Tanja