Hi, all!
I’ve recently followed an EXTREMELY helpful “tutorial” about a “preloading” photo gallery involving Scotty, and I got everything to work perfectly (as that usually is when Scotty’s involved). However, previous to this tutorial, I had a “glossy” graphic layer that stayed above the loaded photos, so it looked like every photo had a glass encasement. Now that I’ve started using Scotty’s method, apparently, the code creates an empty movieclip above all other layers, and places the photos in it.
So, my question is: how do I keep this glossy graphic layer above the photos even though the movieclip loads above it? Can I do it with actionscript???
(Here’s the code I currently have for my photo gallery - thanks 2 Scotty!!!):
var pathToPics = "Photos/Sonic Photos/Cheer Camp '05/Cheer Camp '05/";
var pArray = new Array();
pArray = ["DSC00346.jpg", "DSC00351.jpg", "DSC00352.jpg", "DSC00353.jpg", "DSC00354.jpg", "DSC00355.jpg", "DSC00356.jpg", "DSC00359.jpg", "DSC00360.jpg", "DSC00363.jpg", "DSC00375.jpg", "DSC00376.jpg", "DSC00377.jpg", "DSC00381.jpg", "DSC00384.jpg", "DSC00385.jpg", "DSC00386.jpg"];
var fadeSpeed = 10;
var pIndex = 0;
var i = pArray.length-1;
var j = 0;
photo._visible = 0;
var current;
function preload() {
var photoD = photo.duplicateMovieClip("photo"+i, 100-i);
photoD.loadMovie(pathToPics+pArray*);
var temp = this.createEmptyMovieClip("tmp", i);
temp.onEnterFrame = function() {
var t = photoD.getBytesTotal();
var l = photoD.getBytesLoaded();
info.text = "picture "+(j+1)+" of "+pArray.length+" total loading";
if (t == l && t>4) {
photoD._alpha = 0;
j++;
nextPicture();
delete this.onEnterFrame;
}
};
}
function nextPicture() {
if (i>0) {
i--;
preload();
} else {
this["photo"+i].onEnterFrame = fadeIn;
j = 0;
info.text = "";
}
}
MovieClip.prototype.fadeOut = function() {
if (this._alpha>fadeSpeed) {
this._alpha -= fadeSpeed;
} else {
this._alpha = 0;
delete this.onEnterFrame;
}
};
MovieClip.prototype.fadeIn = function() {
if (this._alpha<100-fadeSpeed) {
this._alpha += fadeSpeed;
} else {
current = this;
this._alpha = 100;
delete this.onEnterFrame;
}
};
function changePic(n) {
j += n;
if (j>pArray.length-1) {
j = 0;
}
if (j<0) {
j = pArray.length-1;
}
current.onEnterFrame = fadeOut;
this["photo"+j].onEnterFrame = fadeIn;
}
next_btn.onRelease = function() {
changePic(1);
};
prev_btn.onRelease = function() {
changePic(-1);
};
preload();
Thanks!
-Shadownetspy