kann mir bitte mal jemand sagen, wo oder wie ich nach dem letzten Bild in der Slideshow wieder auf meiner Hauptzeitleiste auf Bild 1 lande? Die Slideshow fängt immer wieder von vorne an. Möchte es aber nur einmal durchlaufen lassen und dann zurück springen.
Vielen Dank
PHP-Code:
var main = this;
thumbpath = "miniaturen/";
picpath = "pics/";
slidetime = 1;
faktor = 0;
auscount = 0;
kino.an = 1;
bcount = 8;
buttonarr = [];
texte = [];
files = [];
var bgcol = 0xfbe9a1;
maxb = display._width-2;
maxh = display._height-2;
textfarbe = new TextFormat();
textfarbe.color = 0x003366;
textfarbe.font = "Verdana";
textfarbe.size = 10;
//textfarbe.align = "center";
txt.backgroundColor = bgcol;
txt.borderColor = 0x3d62ac;
txt.text = "willkommen";
txt.setNewTextFormat(textfarbe);
var m = new XML();
m.ignoreWhite = true;
m.onLoad = function(ok) {
if (ok) {
anzahl = this.firstChild.childNodes.length;
for (var i = 0; i<=anzahl; i++) {
texte[i] = [];
files[i] = [];
texte[i].push(this.firstChild.childNodes[i].attributes.texte);
files[i].push(this.firstChild.childNodes[i].attributes.titel);
}
txt.text = texte[0];
dis.laden(1);
create();
}
};
m.load("files2.xml");
//?rand="+random(9999))
MovieClip.prototype.paint = function(farbe, breite, hoehe, alpha) {
with (this) {
moveTo(0, 0);
lineStyle(0, farbe, 0);
beginFill(farbe, alpha);
lineTo(breite, 0);
lineTo(breite, hoehe);
lineTo(0, hoehe);
lineTo(0, 0);
endFill();
}
};
create = function () {
for (var i = 1; i<=anzahl; i++) {
var control = prev.holder.createEmptyMovieClip('control'+i, -i+10000);
control.id = i;
var mc = prev.holder.createEmptyMovieClip('holder'+i, -i);
mc._y = -25;
mc._x = (i-1)*58+4;
mc.loadMovie(thumbpath+files[i-1], 0);
buttonarr.push(mc);
control.onEnterFrame = function() {
if (this._parent["holder"+this.id]._width>0) {
var mc1 = this._parent["holder"+this.id];
mc1.id = this.id;
mc1.onPress = function() {
var dis = display.createEmptyMovieClip("anzeige"+bcount, bcount);
bcount++;
aus();
dis.laden(this.id);
txt.text = texte[this.id-1];
};
delete this.onEnterFrame;
}
};
}
};
MovieClip.prototype.moveleft = function(ziel, breite) {
if (this._x>(-breite+520)) {
this.onEnterFrame = function() {
this._x += (-this._x+ziel)*.3;
if (Math.round(this._x) == ziel) {
this._x = ziel-2;
delete this.onEnterFrame;
left.enabled = right.enabled=true;
}
};
} else {
left.enabled = right.enabled=true;
}
};
MovieClip.prototype.moveright = function(ziel, breite) {
if (this._x<-500) {
this.onEnterFrame = function() {
this._x += (-this._x+ziel)*.3;
if (Math.round(this._x) == ziel) {
this._x = ziel+2;
delete this.onEnterFrame;
left.enabled = right.enabled=true;
}
};
} else {
left.enabled = right.enabled=true;
}
};
MovieClip.prototype.posit = function(aktu) {
if (this._width<this._height) {
count = 1;
faktor = this._width/this._height;
} else {
count = 0;
faktor = this._height/this._width;
}
trace(count+" "+faktor);
if (faktor == 1 && this._height>maxh)
{
this._height = this._width=maxh-2;
}
if (faktor<1 && count == 0)
{
if (this._width>maxb-2)
{
this._width = maxb-2;
this._height=this._width*faktor
if (this._height>maxh-2)
{
this._height = (maxh-2);
this._width = (this._height-2)/faktor;
}
}
}
if (faktor<1 && count == 1)
{
this._height = maxh-2;
this._width = (maxh-2)*faktor;
}
this._x = -this._width/2;
this._y = -this._height/2;
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 5;
display["anzeige"+(bcount-2)]._alpha -= 5;
} else {
delete this.onEnterFrame;
display["anzeige"+(bcount-2)].removeMovieClip();
an();
if (kino.an == 1) {
slide();
}
}
};
};
MovieClip.prototype.laden = function(id) {
main.aktu = id;
this.createEmptyMovieClip("flaeche", 1);
this.flaeche._x = -display._width/2+2;
this.flaeche._y = 142;
this.createEmptyMovieClip("hold", 0);
this.createEmptyMovieClip("status", 2);
this.createEmptyMovieClip("texte", 3);
this.texte.createTextField("txt", 0, 0, -20, 200, 20);
this.texte.txt.setNewTextFormat(textfarbe)
this.hold.loadMovie(picpath+files[id-1], 0);
this.hold._alpha = 0;
this.texte._x = -100;
this.texte._y = 160;
this.status.paint(0x00, 200, 2, 100);
this.status._xscale = 0;
this.flaeche.paint(bgcol, display._width-4, 30, 100);
this.status._x = -100;
this.status._y = 160;
this.status.onEnterFrame = function() {
prozent = this._parent.hold.getBytesLoaded()/this._parent.hold.getBytesTotal()*100;
if (this._parent.hold.getBytesTotal()<=0) {
this._parent.texte.txt.text = "searching... "+files[id-1];
} else {
this._parent.texte.txt.text = "loading... "+files[id-1]+" "+this._parent.hold.getBytesTotal()+" b total";
}
this._parent.texte.txt.setTextFormat(textfarbe);
if (this._parent.hold._width>0) {
this._parent.hold.posit();
this._parent.texte.removeMovieClip();
this._parent.flaeche.removeMovieClip();
this.removeMovieClip();
} else {
this._xscale += (-this._xscale+prozent)*.3;
}
};
};
right.onPress = function() {
this.enabled = left.enabled=false;
breite = prev.holder._width;
prev.holder.moveright(Math.round(prev.holder._x+520), breite);
};
left.onPress = function() {
this.enabled = right.enabled=false;
breite = prev.holder._width;
prev.holder.moveleft(Math.round(prev.holder._x-520), breite);
};
up.onPress = function() {
this.onEnterFrame = function() {
txt.scroll += 1;
};
};
up.onRelease = function() {
delete this.onEnterFrame;
};
down.onPress = function() {
this.onEnterFrame = function() {
txt.scroll -= 1;
};
};
down.onRelease = function() {
delete this.onEnterFrame;
};
function aus() {
for (var i = 0; i<buttonarr.length; i++) {
buttonarr[i].enabled = 0;
}
rueck.enabled = 0;
vor.enabled = 0;
left.enabled = 0;
right.enabled = 0;
kino.an == 0 ? kino.enabled=0 : kino.enabled=1;
}
function an() {
if (auscount == 0) {
for (var i = 0; i<buttonarr.length; i++) {
buttonarr[i].enabled = 1;
}
rueck.enabled = 1;
vor.enabled = 1;
left.enabled = 1;
right.enabled = 1;
kino.enabled = 1;
}
}
rueck.onPress = function() {
if (main.aktu>1) {
var dis = display.createEmptyMovieClip("anzeige"+bcount, bcount);
bcount++;
aus();
dis.laden(main.aktu-1);
txt.text = texte[main.aktu-1];
}
};
vor.onPress = function() {
if (main.aktu<anzahl) {
var dis = display.createEmptyMovieClip("anzeige"+bcount, bcount);
bcount++;
aus();
dis.laden(main.aktu+1);
txt.text = texte[main.aktu-1];
}
};
kino.onPress = function() {
if (this.an == 0) {
aus();
slide();
this.enabled = 1;
this.an = 1;
this.txt.text = "stop";
auscount = 1;
txt.text = "loading slideshow...";
} else if (this.an == 1) {
this.an = 0;
this.txt.text = "slideshow";
auscount = 0;
//an()
}
};
slide = function () {
inter = setInterval(function () { clearInterval(inter);delete inter;var dis = display.createEmptyMovieClip("anzeige"+bcount, bcount);bcount++;if (main.aktu<anzahl) {dis.laden(main.aktu+1);txt.text = texte[main.aktu-1];} else {dis.laden(1);txt.text = texte[0];}}, slidetime*1000);
};
var dis = display.createEmptyMovieClip("anzeige"+bcount, bcount);
bcount++;
aus();
txt.setTextFormat(textfarbe);