Hey superkax :), worked out the alpha problem this is the final code, all i need to do now is add a preloader percent and bar.
_global.subgallery=0, _global.index=0,
gallery = [whatever];
gallerytext = [whatever];
galleryurl = [whatever];
this.fadeSpeed = 20;
delay = 3000;
for (i=1; i<=4; i++) {
test["sub"+i].i = i-1;
test["sub"+i].onRelease = function() {
_global.subgallery = this.i;
_global.index = 0;
this._parent._parent.pic.loadMovie(gallery[subgallery][index]);
this._parent._parent.currentImage.text = gallerytext[subgallery][index];
this._parent._parent.onEnterFrame = fadeOut;}
};
function fadeOut() {
if (_root.photo._alpha>fadeSpeed) {
_root.photo._alpha -= fadeSpeed;
} else {
delete this.onEnterFrame;
this.loadPhoto();
}
};
function loadPhoto() {
// specify the movieclip to load images into
var p = this.pic;
//------------------------------------------
p._alpha = 0;
p.loadMovie(gallery[subgallery][index]);
this.onEnterFrame = loadMeter;
};
function loadMeter() {
var i, l, t;
l = this.pic.getBytesLoaded();
t = this.pic.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
function fadeIn() {
if (this.pic._alpha<100-this.fadeSpeed) {
this.pic._alpha += this.fadeSpeed;
} else {
this.pic._alpha = 100;
this.onEnterFrame = null;
}
};
prevPic.onRelease = function() {
_global.index>0 ? _global.index-- : _global.index=gallery[subgallery].length-1;
this._parent.pic.loadMovie(gallery[subgallery][index]);
this._parent.currentImage.text = gallerytext[subgallery][index];
this._parent.onEnterFrame = fadeOut;
myInterval = setInterval(changePhoto, delay);
};
nextPic.onRelease = function() {
_global.index<gallery[subgallery].length-1 ? _global.index++ : _global.index=0;
this._parent.pic.loadMovie(gallery[subgallery][index]);
this._parent.currentImage.text = gallerytext[subgallery][index];
this._parent.onEnterFrame = fadeOut;
myInterval = setInterval(changePhoto, delay);
};
launch.onRelease = function() {
getURL(galleryurl[subgallery][index], "_blank");
};