Hi guys, I’m so stuck on this one so I really hope that you can help me out.
I’m making a Portfolio with all the content dynamically loaded from an XML-file. Every “case” in the portfolio (xml-file) has got one image-url-field. The XML is preloaded when the user enters the site, and all the images are being preloaded sequencially, one load for each case. Everything works fine when running it local, and even when simulating download in Flash, but it all becomes messed up when looking at the site online.
The problem is that the preloader doesn’t show up, and everything BUT the image are “faded onto” on stage. The strange thing is that this just happens occasionally, usually after a while when browsing through the different portfolio entries with the “next” and the “previous” button. At first the preloader is shown and the portfolio entry is faded onto screen, just like I want it to be.
Why are the preloader being “ignored” only occasionally? And why do the images sometime doesn’t appear on the screen, even after like 30 seconds when they definatley have been preloaded?
Below is the code for the Image preloader.
If you can help here I owe you big time!
Thanks in advance,
Jonas
import com.mosesSupposes.fuse.*;
ZigoEngine.register(Fuse, PennerEasing);
_global.hereWeGo = "NO";
_global.showTheBar = "NO";
xmlLoader._visible = false;
var filesize:Number;
var loaded:Number;
this.onEnterFrame = function() {
if(_global.two == "WEB" || _global.two == "PRINT") {
filesize = _root.projects.pImage.pHolder.getBytesTotal();
loaded = _root.projects.pImage.pHolder.getBytesLoaded();
} else if (_global.two == "PHOTO") {
filesize = _root.pGallery.photoHolder.theImage.getBytesTotal();
loaded = _root.pGallery.photoHolder.theImage.getBytesLoaded();
}
if (loaded != filesize) {
xmlLoader._visible = true;
xmlLoader._alpha = 30;
var loadedPercent:Number = 100*loaded/filesize;
xmlLoader.percentLoadedTxt.text = Math.ceil(loadedPercent);
} else {
if (_global.hereWeGo == "YES") {
xmlLoader.percentLoadedTxt.text = 100;
_global.hereWeGo="NO";
_global.showTheBar = "NO";
if(_global.typeOfUp == "FIRST"){
xmlLoaderOut.start();
} else {
xmlLoaderOut.start();
sneakchange.start();
if (_global.typeOfClick == "WEB") {
webClickFuse.start();
}
if (_global.typeOfClick == "PRINT") {
printClickFuse.start();
}
if (_global.typeOfClick == "PHOTO") {
photoClickFuse.start();
}
}
}
}
};
function inMedSkiten():Void {
if(_global.two == "WEB" || _global.two == "PRINT") {
projectsIn.start();
_root.projects._visible = true;
_root.pGallery._visible = false;
}
else if (_global.two == "PHOTO") {
photoIn.start();
_root.pGallery._visible = true;
_root.projects._visible = false;
}
}
var xmlLoaderOut:Fuse = new Fuse([
{target:_root.xmlLoader, alpha:0, time:1, ease:"easeInSine"},
{func:inMedSkiten, delay:0.1},
{func: function() {_root.xmlLoader._visible = false; _root.xmlLoader.gotoAndStop(1)}, delay:1}
]);