I have a site set up with a maintimeline and 5 external loading swfs for the sections.
In one of the swfs I have implemented the kirupa photo gallery:
http://www.kirupa.com/developer/mx/photogallery.htm
but with a slight modifier so that it advances on its own. When I test the movie it loads only the first picture and does not move forward from there.
Any help would be greatly appreciated.
// fill this array with your pics
this.pathToPics = "../images/Lounge/";
// fill this array with your pics
this.pArray = ["Pic1.jpg", "Pic2.jpg","Pic3.jpg","Pic4.jpg"];this.fadeSpeed = 50;
this.pIndex = 0;
var p = this.photo;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie (this.pathToPics + this.pArray[0], p);
MovieClip.prototype.changePhoto = function (d)
{
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex + d) % this.pArray.length;
if (this.pIndex < 0)
{
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function ()
{
if (this.photo._alpha > this.fadeSpeed)
{
this.photo._alpha -= this.fadeSpeed;
}
else
{
this.loadPhoto ();
}
};
MovieClip.prototype.loadPhoto = function ()
{
// specify the movieclip to load images into
//------------------------------------------
p._alpha = 0;
p.loadMovie (this.pathToPics + this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function ()
{
var i, l, t;
l = this.photo.getBytesLoaded ();
t = this.photo.getBytesTotal ();
if (t > 0 && t == l)
{
this.onEnterFrame = fadeIn;
}
else
{
trace (l / t);
}
};
MovieClip.prototype.fadeIn = function ()
{
if (this.photo._alpha < 100 - this.fadeSpeed)
{
this.photo._alpha += this.fadeSpeed;
}
else
{
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
this.onKeyDown = function ()
{
if (Key.getCode () == Key.LEFT)
{
this.changePhoto (-1);
}
else if (Key.getCode () == Key.RIGHT)
{
this.changePhoto (1);
}
};
Key.addListener (this);
function setTimer () {
autoTimer = 2000;
clearInterval (autoSlideInterval);
autoSlideInterval = setInterval (autoSlide, autoTimer);
}
function autoSlide () {
changePhoto (1);
setTimer ();
}
autoSlide ();
:*(