[FONT=Times New Roman][SIZE=3]Hi[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Through reading all the xml slideshow threads on here and mixing and matching a few of them (stringy and scottys) I’ve come up with this………… the problem I have now is that I’m trying to get a next/previous button working for each gallery in addition to the thumbs an not being to hot on AS and after a week of banging my head against a brick wall I though id ask here for some help.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]The code is as follows (well part of it anyway) any help would be really welcome in the meantime i’ll carry on banging my head against the wall although i’m knocking threw to next door.[/SIZE][/FONT]
stop();
var tnNr;
var curLength;
content_mc._alpha = 0;
spacing = 10;
container._alpha = 0;
border._alpha = 0;
border._y = Stage.height/2;
border._x = Stage.width/2;
th_nav._y = 105;
MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
resizeReset();
w = container._width;
h = container._height;
if (w != 0 && h != 0) {
scaler = scalerf(w, h);
if (scaler != 100) {
container._xscale = scaler;
container._yscale = scaler;
}
}
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
border._alpha = 100;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
container._alpha = 0;
this.onEnterFrame = function() {
this.tween(["_width", "_height"], [w, h], 1, "easeOutExpo");
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
info._alpha = 0;
container._y = Stage.height/2-container._height/2;
container._x = Stage.width/2-container._width/2;
info.tween("_x", border._x-border._width/2, 1);
info.tween("_y", border._y+border._height/2+20, 1);
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
info.alphaTo(100, 3);
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes*.attributes.source);
tArray.push(gallery.childNodes*.attributes.thumb);
iArray.push(gallery.childNodes*.attributes.title);
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("SE1gallery.xml");
//my_xml.load("SE1gallery.xml?"+(new Date()).getTime());
}
///make thumbs//
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = th_nav.thmb.duplicateMovieClip("thmb"+i, 0+i);
th_nav["thmb"+i].box.xSlideTo(75, 1.0, "easeOutExpo");
th_nav["thmb"+i].alphaTo(20, 0.5, "linear");
thb.id = i;
thb._x = i%3*25;
thb._y = Math.floor(i/3)*25;
}
loadButtons();
}
function loadButtons() {
var tbox = th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
/////////////////
//////////////////////////
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
};
but.onRollOver = function() {
this.alphaTo(100, 1, "linear");
};
but.onRollOut = function() {
this.alphaTo(20, 1, "linear");
};
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);
}
butArray = new Array();
butArray = ["about_btn", "gallery1_btn", "gallery2_btn", "contact_btn"];
function mainButtons() {
for (var i = 0; i<butArray.length; i++) {
this.globalNav_mc[butArray*].onRollOver = function() {
//this.ySlideTo(15, 0.5, "easeOutExpo");
this.colorTo(0x33CCFF, 2);
};
this.globalNav_mc[butArray*].onRollOut = function() {
//this.ySlideTo(0, 0.5, "easeOutExpo");
this.colorTo(null, 2);
};
this.globalNav_mc[butArray*].id = i;
this.globalNav_mc[butArray*].onRelease = function() {
th_nav.xSlideTo(-10, 1.0, "easeOutExpo");
this.ySlideTo(0, 0.5, "easeOutExpo");
galleryChoice(this.id);
disButtons(this.id);
};
}
}
///thumb numbers pics or thumb jpegs///
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.th_nav["thmb"+i].enabled = 1;
this.th_nav["thmb"+i].alphaTo(20, 1, "linear");
//this.th_nav["thmb"+i].box.ySlideTo(0, 0.5, "easeOutExpo");
} else {
this.th_nav["thmb"+i].enabled = 0;
this.th_nav["thmb"+i].alphaTo(100, 1, "linear");
//this.th_nav["thmb"+i].box.ySlideTo(15, 0.5, "easeOutExpo");
}
}
}
//gallery buttons active and in-active//
function disButtons(d) {
for (var i = 0; i<butArray.length; i++) {
if (i != d) {
this.globalNav_mc[butArray*].colorTo(null, 2);
this.globalNav_mc[butArray*].enabled = true;
//this.globalNav_mc[butArray*].ySlideTo(0, 0.5, "easeOutBounce");
} else {
this.globalNav_mc[butArray*].colorTo(0x33CCFF, 2);
this.globalNav_mc[butArray*].enabled = false;
//this.globalNav_mc[butArray*].ySlideTo(0, 0.5, "easeOutBounce");
}
}
}
function scalerf(w, h) {
//this.tween(["_width", "_height"], [w, h], 1, "easeOutExpo");
bigframew = Stage.width-10;
bigframeh = Stage.height-190;
diffw = (w-bigframew);
diffh = (h-bigframeh);
if (diffw<=0 && diffh<=0) {
scaler = 1*100;
} else if (diffw == Math.max(diffw, diffh)) {
//scale to height
scaler.tween = (bigframew/w)*100;
} else if (diffh == Math.max(diffw, diffh)) {
//scale to width
scaler = (bigframeh/h)*100;
}
return scaler;
}
function resizeReset() {
container._xscale = container._yscale=100;
}
disButtons(0);
galleryChoice(0);
//// nav & footer fade in//
globalNav_mc.alphaTo(100, 1, "linear");
email_mc.alphaTo(100, 1, "linear");
phone_mc.alphaTo(100, 1, "linear");
copyright_mc.alphaTo(100, 1, "linear");
footer_mc.alphaTo(100, 1, "linear");
Thanks
Manny