Matthias Kannengiesser
Erfahrenes Mitglied
Hi Folks,
Hier ein XML DiaSlider, ein besserer Name ist mir nicht eingefallen. Viel Spass beim rumspielen. Entstanden ist das Monster im Flashforum.
Beispiel:
hier kucken
Liebe Grüsse
Matze K.
Hier ein XML DiaSlider, ein besserer Name ist mir nicht eingefallen. Viel Spass beim rumspielen. Entstanden ist das Monster im Flashforum.
PHP:
meinXML = new XML();
meinXML.ignoreWhite = true;
meinXML.load("bilder.xml");
loadstatus.text = "LOADING...";
meinXML.onLoad = function(status) {
if (status) {
tempxml = meinXML.firstChild.childNodes;
anzahl = tempxml.length;
_root.slideBand("container", "bild", 1, 0, 10.0, anzahl, 200, 1, 1.1, 120);
loadstatus.text = "";
delete meinXML;
}
};
function slideBand(obj, clip, tiefe, ziel, speed, bildanzahl, bildbreite, bildnummer, abstand, posY) {
createEmptyMovieClip(obj, tiefe);
for (var i = 1; i <= bildanzahl; i++) {
this[obj].attachMovie(clip, clip + i, i);
this[obj][clip + i]._x = this[obj][clip add i]._width * i * abstand;
this[obj][clip + i]._y = posY;
this[obj][clip + i].bild = i;
this[obj][clip + i].titel.text = tempxml[i-1].attributes.titel;
this[obj][clip + i].onRelease = function() {
bildnummer = this.bild;
};
this[obj][clip + i].mc.loadMovie("pics/" + tempxml[i-1].firstChild);
this[obj][clip + i].balken_mc._xscale = 0
this[obj][clip + i].onEnterFrame = function() {
if (this.mc.getBytesLoaded() > 10) {
this.gesamt = this.mc.getBytesTotal();
this.bereits = this.mc.getBytesLoaded();
this.prozent = this.bereits*100/this.gesamt;
this.balken_mc._xscale = this.prozent;
if (this.prozent == 100) {
this.balken_mc._visible = 0;
delete this.onEnterFrame;
}
}
};
}
this[obj].onEnterFrame = function() {
this.xdiff = this[clip + bildnummer]._x - ziel;
if (this.xdiff != 0) {
this.xdiff = this.xdiff / speed;
for (var i = 1; i <= bildanzahl; i++) {
this[clip + i]._x -= this.xdiff;
if (this[clip + i]._x <= (ziel - bildbreite)) {
this[clip + i]._x += bildanzahl * bildbreite * abstand;
}
}
}
};
}
Beispiel:
hier kucken
Liebe Grüsse
Matze K.