I work for my gallery project with PC Windows and I tested on IE Windows. However today I test them on Mac Safari and Firefox, as well as on Windows Firefox, the preloader shows NaN and as a result, the image does not shows up.
Can somebody care to look ath the code, where should I change in order to get rid of those error ? :
MovieClip.prototype.createGallery = function()
{
_global.totalImages = this.totalImages;
_global.currentJob = slideHolder.slide.jobThumbs[this._name];
//if(initValueG)initValueG = false;
//slideHolder.slide.slideControl.enabled = false;
//slideHolder.slide.slideControl.opening.alphaTo(100, 0.3);
//slideHolder.slide.slideControl.closing.alphaTo(0, 0.3);
//slideValue = "close";
//slideHolder.slide.slideTo(-225, 0, 0.5, "easeOutExpo");
//galleryInitSetup();
//mainTL.galleryHolder.imageSection.imageTrans.scaleTo(100, 0.5, "easeInOutExpo");
mainTL.galleryHolder.imageSection.alphaTo(100, 0.5, "easeInOutExpo");
mainTL.galleryHolder.imageSection.imageTrans.alphaTo(100, 0.5, "easeInOutExpo");
//mainTL.galleryHolder.infoSection.infoTrans.alphaTo(100, 0.5, "easeInOutExpo", 0.2);
mainTL.galleryHolder.infoSection.infoTrans._alpha = 100;
//mainTL.galleryHolder.thumbSection.thumbTrans.scaleTo(100, 0.5, "easeInOutExpo", 0.4, addLoaders);
mainTL.galleryHolder.thumbSection.thumbTrans.alphaTo(100, 0.3, "easeInExpo", 0, addLoaders);
////////////////////
}
function addLoaders()
{
var commonMC = mainTL.galleryHolder;
commonMC.infoSection.infoBack._visible = true;
commonMC.thumbSection.thumbBackSection._visible = true;
commonMC.imageSection.attachMovie("animLoader", "animLoader", 10);
commonMC.infoSection.attachMovie("initLoader", "initLoader", 10);
commonMC.thumbSection.attachMovie("initLoader", "initLoader", 20);
commonMC.imageSection.animLoader._alpha = 100;
commonMC.imageSection.animLoader._x = 0;
commonMC.imageSection.animLoader._y = 0;
commonMC.infoSection.initLoader._alpha = 100;
commonMC.infoSection.initLoader._x = 10;
commonMC.infoSection.initLoader._y = 10;
commonMC.thumbSection.initLoader._alpha = 100;
commonMC.thumbSection.initLoader._x = 10;
commonMC.thumbSection.initLoader._y = 10;
getGalleryData();
}
function getGalleryData()
{
for (var i = 0; i<_global.totalImages;i++)
{
var t = galleryHolder.thumbSection.thumbsHolder.attachMovie("sThumb", i, i);
t.imagePath = jobObj["job" + _global.currentJob._name]["image" + i].imagePath;
t.thumbPath = jobObj["job" + _global.currentJob._name]["image" + i].thumbPath ;
t.thumbN.text = ".0" + (i+1);
t.attachMovie("sThumbOver", "sThumbOver", 2);
t.createEmptyMovieClip("holdThumb", 1);
t.holdThumb.loadMovie(t.thumbPath);
if(i < 6) t._x = (47 + 16) * i;
else if(i > 2 && i < 4)
{
t._x = Math.round((47 + 16) * (i-3));
t._y = 45;
}
else if(i > 5)
{
t._x = Math.round((47 + 16) * (i-6));
t._y = 45;
}
t.onRollOver = function()
{
if(currentThumb!=this._name)
{
this.sThumbEffect.alphaTo(100, 0.2, "easeInQuad");
}
}
t.onRollOut = function()
{
if(currentThumb!=this._name)
{
this.sThumbEffect.alphaTo(0, 0.2, "easeInQuad");
}
}
t.onRelease = function()
{
if(currentThumb!=this._name)
{
disableAllThumbs();
slideHolder.slide.slideControl.enabled = false;
//this.enabled = false;
this._parent[currentThumb].sThumbEffect.alphaTo(0, 0.2, "easeInQuad");
currentThumb = this._name;
mainTL.galleryHolder.imageSection.animLoader.removeMovieClip();
mainTL.galleryHolder.imageSection.whiteBack._alpha = 100;
mainTL.galleryHolder.imageSection.imageHolder.alphaTo(0, 0.3, "easeInExpo", 0, loadImageIn);
}
}
}
currentThumb = 0;
//galleryHolder.thumbSection.thumbsHolder[currentThumb].enabled = false;
disableAllThumbs();
galleryHolder.thumbSection.thumbsHolder[currentThumb].sThumbEffect._alpha = 100;
galleryHolder.imageSection.imageHolder.loadMovie(galleryHolder.thumbSection.thumbsHolder[currentThumb].imagePath);
galleryHolder.infoSection.title.text = _global.currentJob.name;
scrollSetup(_global.currentJob.descPath);
}
function loadImageIn()
{
var commonMC = mainTL.galleryHolder;
commonMC.imageSection.imageHolder.unloadMovie();
commonMC.imageSection.imageHolder.loadMovie(commonMC.thumbSection.thumbsHolder[currentThumb].imagePath);
delayInterval = setInterval(setupImageLoading, 10);
}
function setupImageLoading()
{
clearInterval(delayInterval);
var target_mc = mainTL.galleryHolder.imageSection.imageHolder;
var loaded = target_mc.getBytesLoaded();
var total = target_mc.getBytesTotal();
var pctLoaded = loaded/total*100;
if (loaded>0 && loaded>=total)
{
mainTL.galleryHolder.imageSection.imageHolder.alphaTo(100, 0.3, "easeOutExpo", 0, enableAllThumbs);
//mainTL.galleryHolder.imageSection.animLoader.removeMovieClip();
}
else
{
var commonMC = mainTL.galleryHolder;
commonMC.imageSection.attachMovie("animLoader", "animLoader", 10);
commonMC.imageSection.animLoader._alpha = 100;
commonMC.imageSection.animLoader._x = 213;
commonMC.imageSection.animLoader._y = 160;
commonMC.imageSection.animLoader.loaderPer.text = " ";
//mainTL.galleryHolder.imageSection.whiteBack.alphaTo(100, 0.3, "easeOutExpo", 0);
easedLoaded = 0;
myInterval = setInterval(checkLoadedImage, 10);
}
}
function checkLoadedImage()
{
var target_mc = mainTL.galleryHolder.imageSection.imageHolder;
var loaded = target_mc.getBytesLoaded();
var total = target_mc.getBytesTotal();
var pctLoaded = Math.round(loaded/total*100);
easedLoaded += Math.ceil((pctLoaded - easedLoaded) / 5);
mainTL.galleryHolder.imageSection.animLoader.loaderPer.text = easedLoaded;
if (loaded>0 && loaded>=total && mainTL.galleryHolder.imageSection.animLoader.loaderPer.text == "100")
{
mainTL.galleryHolder.imageSection.animLoader.loaderPer.text = "100";
mainTL.galleryHolder.imageSection.animLoader.scaleTo(120, 0.3, "easeInExpo", 0);
mainTL.galleryHolder.imageSection.animLoader.alphaTo(0, 0.3, "easeInExpo", 0, showLoadedImage);
clearInterval(myInterval);
}
}
function showLoadedImage()
{
mainTL.galleryHolder.imageSection.imageHolder.alphaTo(100, 0.3, "easeOutExpo", 0, enableAllThumbs);
mainTL.galleryHolder.imageSection.animLoader.removeMovieClip();
}
Thanks