Hallo Mitstreiter,
ich habe, hm nicht wirklich n Problem, eher ein Unart.
Also die Galerie, die ich erstellt habe, lädt eine XML-Datei mit folgenden Daten: Bild, Breite, Höhe, Versatz vom 0 Punkt und ein Kommentar zum Foto.
Macht er auch alles hervorragend, NUR nicht wenn man das erste Mal auf den Button klickt.
Der Loading Prozess wird gestartet, es wird bis 100% hochgezählt und dann... nichts. Das Bild wird nicht angezeigt. Beim zweiten Klick auf den Button für die Galerie, erscheint das Bild dann sofort.
Meine Frage woran liegt das?
Hier n Ausschnitt aus der XML-Datei:
PHP-Code:
<?xml version="1.0" encoding="UTF-8" ?>
<gallery>
<pic src="a08.jpg" px="700" py="520" yo="77"><![CDATA[<font color="#000000">Deckelgefaess</font><br /><br /><font color="#7D7D7C"><br /></font>]]></pic>
<pic src="a09.jpg" px="700" py="520" yo="77"><![CDATA[<font color="#000000">Loeffel</font><br /><br /><font color="#7D7D7C"><br /></font>]]></pic>
<pic src="a10.jpg" px="700" py="520" yo="77"><![CDATA[<font color="#000000">Schale,<br />Menageteil,<br />Streuer</font><br /><br /><font color="#7D7D7C"><br /></font>]]></pic>
</gallery>
Hier mal mein Script:
PHP-Code:
//Initiate Gallery
function gallerys() {
_root.attachMovie("gallery", "gallery", 20, 0, 0);
// Text-Area
if (vis) {
if(wtxt != "") {
_root.gallery.info_panel.panel.paneltxt.htmlText = wtxt;
// trace(_root.gallery.info_panel.panel.paneltxt.htmlText);
if (roll == 1) {
_root.gallery.info_panel.panel.sb._visible = true;
oben = _root.gallery.info_panel.panel.sb.balken._y;
bhoehe = _root.gallery.info_panel.panel.sb.balken._height;
khoehe = _root.gallery.info_panel.panel.sb.scroller._height;
unten = (oben+bhoehe)-khoehe;
_root.gallery.info_panel.panel.sb.scroller.onPress = function() {
startDrag(this, false, _root.gallery.info_panel.panel.sb.scroller._x, oben, _root.gallery.info_panel.panel.sb.scroller._x, unten);
}
_root.gallery.info_panel.panel.sb.scroller.onRelease = function() {
stopDrag();
}
_root.gallery.info_panel.panel.sb.scroller.onReleaseOutside = function() {
stopDrag();
}
_root.gallery.info_panel.panel.sb.scroller.onEnterFrame = function() {
_root.gallery.info_panel.panel.paneltxt.scroll = Math.round(((_root.gallery.info_panel.panel.sb.scroller._y-oben)/(bhoehe-khoehe))*_root.gallery.info_panel.panel.paneltxt.maxscroll);
}
}
else {
_root.gallery.info_panel.panel.sb._visible = false;
}
}
else {
_root.gallery.info_panel.panel.paneltxt.htmlText = "Text konnte nicht geladen werden.";
}
}
else {
_root.gallery.info_panel._visible = false;
}
// Gallery-Area
gallery.picCounts = picsrc.length;
if(gallery.picCounts < 10) {
gallery.picCounts = "0" + gallery.picCounts;
}
gallery.whichPict = "01";
gallery.caption.htmlText = piccap[whichPic];
trace("Passed 1");
gallery.nextBut.onPress = function() {
if (whichPic < (picsrc.length-1) && !fadeIn && !fadeOut) {
fadeOut = true;
whichPic++;
gallery.whichPict++;
if(gallery.whichPict < 10) {
gallery.whichPict = "0" + gallery.whichPict;
}
if (_global.opened == 1) {
_root.gallery.info_panel.ibut.gotoAndStop(1);
_root.gallery.info_panel.play();
}
gallery.caption.htmlText = piccap[whichPic];
trace("nextTriggered");
}
trace("nextPressed");
};
trace("Passed 2");
gallery.backBut.onPress = function() {
if (whichPic > 0 && !fadeIn && !fadeOut) {
fadeOut = true;
whichPic--;
gallery.whichPict--;
if(gallery.whichPict < 10) {
gallery.whichPict = "0" + gallery.whichPict;
}
if (_global.opened == 1) {
_root.gallery.info_panel.ibut.gotoAndStop(1);
_root.gallery.info_panel.play();
}
gallery.caption.htmlText = piccap[whichPic];
trace("prevTriggered");
}
trace("prevPressed");
};
trace("Passed 3");
gallery.loading._visible = true;
gallery.onEnterFrame = function() {
// trace ("Running...");
// when a new Photo is selected, fade out, load new image, and fade in
if (gallery.holder._alpha > 10 && fadeOut) {
gallery.holder._alpha -= 10;
trace ("Fade out done");
}
if (gallery.holder._alpha < 10) {
mclL.onLoadProgress = function(target, loaded, total){
gallery.loading.percent.text = Math.round((loaded/total) * 100) + "%";
trace ("Loading..");
}
mclL.onLoadInit = function(){
gallery.loading._visible = false;
gallery.loading.percent.text = "";
trace ("Init Pic");
}
mcl.addListener(mclL);
gallery.loading._visible = true;
mcl.loadClip(path + picsrc[whichPic], gallery.holder);
gallery.holder._width = picx[whichPic];
gallery.holder._height = picy[whichPic];
gallery.holder._y = picOffset[whichPic];
fadeOut = false;
fadeIn = true;
trace ("Load Pic");
}
if (gallery.holder._alpha < 100 && fadeIn && !fadeOut) {
gallery.holder._alpha += 10;
trace ("Fade In done");
}
else {
fadeIn = false;
}
}
gallery.holder._alpha = 0;
}
Hier ein Beispiel für die Galerie:
Beispiel
Vielen Dank für Hinweise, würd mir wirklich helfen.