Hi,
I have read and used the photogallery from Kirupa and have modified it to fit the site I am trying to develop for a friend (he is a musican and artist). Everything works great locally but when I upload the files weird things are happening. It’s not related to paths because the images are showing up. I am getting a white background behind some of the thumbnails and sometimes the thumbnails don’t show up or load very slow.
Here is the url to the live site: mark stanley’s site
From there if you click art you should see the thumbnails on the left. The first few thumbnails have a white bg and I do not know where that is coming from. The other problem is that the first image thumbnail shows up in the large main picture area (only for the first thumbnail). The only two categories under art working are Mixed Media and Acrylics.
I hate to ask and would like to figure this out myself but I am out of ideas and time. If someone knows this code and could look at it I would really appreciate it. I can email the source but could not upload the FLA do to size. I have pasted the art mc script below.
Thanks!
Ed
http://edwardjonesdesign.com/clients/mms/
stop();
xmlData.unload;
tsa_up.useHandCursor = false;
tsa_down.useHandCursor = false;
//////////////////////////////////////////
var newcategory:String;
if (newcategory == undefined) {
newcategory = "mixedmedia";
category_txt.text = "Mixed Media";
callxmlfile();
}
function set_newcategory() {
xmlData.unload;
p=0;
newcategory = newcategory;
if (newcategory == "mixedmedia") {
category_txt.text = "Mixed Media";
}
if (newcategory == "acrylics") {
category_txt.text = "Acrylics";
}
if (newcategory == "drawings") {
category_txt.text = "Drawings";
}
if (newcategory == "oils") {
category_txt.text = "Oils";
}
callxmlfile();
}
////////////////////////////////
function callxmlfile() {
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
imagename = [];
imagedescription = [];
thumbnails = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
imagename* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
imagedescription* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/mark_stanley_art_"+newcategory+".xml");
}
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
// ///////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
image_percent_loaded = Math.round((loaded/filesize)*100);
preloader.preoad_bar_txt.text = "loading art: "+image_percent_loaded+"%";
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = imagedescription[p];
imagename_txt.text = imagename[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = imagedescription[p];
imagename_txt.text = imagename[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = imagedescription[0];
imagename_txt.text = imagename[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 15;
tscroller.onEnterFrame = function() {
//trace(_root._ymouse);
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
//if ((_root._ymouse>=(hit_right._y-20)) && (thumbnail_mc.hitTest(hit_right))) {
if (hit_right.hitTest(_root._xmouse, _root._ymouse, true) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._y -= scroll_speed;
//trace("scroll minus");
//} else if ((_root._ymouse<=(hit_left._y-20)) && (thumbnail_mc.hitTest(hit_left))) {
} else if (hit_left.hitTest(_root._xmouse, _root._ymouse, true) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._y += scroll_speed;
//trace("scroll plus");
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadStart = function(target:MovieClip):Void {
//trace("started");
};
tlistener.onLoadInit = function(target_mc) {
target_mc._y = 10+(target_mc._height+5)*k;
//trace("target y = "+target_mc._y);
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
//// make sure you can remove these
//trace("k = "+k);
_global.remove_number = k+1;
//trace("remove number = "+remove_number);
}
///// remove these thumbnails before running new xml file
function removethumbnails() {
for (r=0; r<_global.remove_number; r++) {
unloadMovie("thumbnail_mc.t"+r);
p = 0;
set_newcategory();
}
}
And the buttons for the different categories…
on (press) {
newcategory = "mixedmedia"
removethumbnails();
}
And
on (press) {
newcategory = "acrylics"
removethumbnails();
}