Log in

View Full Version : XML Gallery missing pics



parodeis
09-28-2008, 08:40 PM
Okay, I just posted a thread about getting a swf visible on the web, but now I have another problem.

When I load the gallery, there are 2 pics that don't load, and the whole slideshow hangs up on them. When you come across one, the "next" button doesn't work anymore, but when you use the "previous" button, the ss jumps to the image it would have been on if the next button had worked, and it backs up just fine. When going forward after that, everything works until you come to another pic that won't load.

I have checked the pics for anomalies, and the pics have nothing in common that could be doing it--same file size and dimensions as all the others, and one's a gif but the other is jpeg like all the others.

Here is the link (http://www.stephaniedeis.com/portfolio.html) to the page on the web.

Here is the xml:


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>images/skdlogo.gif</image>
<client>stephanie@stephaniedeis.com</client>
<title>Graphic Design Portfolio</title>
<description>A collection of my strongest pieces... </description>
</pic>
<pic>
<image>images/ppfd1.jpg</image>
<client>Pace's Point Fire Department</client>
<title>Direct Mail Brochure</title>
<description>This brochure is the main piece...</description>
</pic>
<pic>
<image>images/ppfd2.jpg</image>
<client>Pace's Point Fire Department</client>
<title>Direct Mail Brochure</title>
<description>...</description>
</pic>
<pic>
<image>images/ppfd3.jpg</image>
<client>Pace's Point Fire Department</client>
<title>Direct Mail Brochure</title>
<description>...</description>
</pic>
<pic>
<image>images/ppfd4.jpg</image>
<client>Pace's Point Fire Department</client>
<title>Direct Mail Brochure</title>
<description>...</description>
</pic>
<pic>
<image>images/drcaposter.jpg</image>
<client>Custom Made Airplanes</client>
<title>Large Trade Show Poster</title>
<description>...</description>
</pic>
<pic>
<image>images/specsheet.jpg</image>
<client>Custom Made Airplanes</client>
<title>Plane Specification Posters</title>
<description>...</description>
</pic>
<pic>
<image>images/cmacard.jpg</image>
<client>Custom Made Airplanes</client>
<title>Business Card</title>
<description>...</description>
</pic>
<pic>
<image>images/gazingballsmall.jpg</image>
<client>Gazing Ball Forest</client>
<title>Gazing Ball Forest</title>
<description>...</description>
</pic>
<pic>
<image>images/pondripples.jpg</image>
<client>Pond Ripples</client>
<title>Pond Ripples</title>
<description>...</description>
</pic><pic>
<image>images/adobe.jpg</image>
<client>Adobe CS3</client>
<title>Adobe Concept Ad</title>
<description>...</description>
</pic><pic>
<image>images/jhicFINAL.jpg</image>
<client>Jolly Humor Ice Cream</client>
<title>Magazine Ad</title>
<description>...</description>
</pic><pic>
<image>images/KayJewels-1.jpg</image>
<client>Kay Jewelers</client>
<title>Magazine Campaign</title>
<description>...</description>
</pic><pic>
<image>images/leboutique1up.jpg</image>
<client>LeBoutique</client>
<title>Direct Mail Postcard, Front</title>
<description>...</description>
</pic><pic>
<image>images/leboutique1uppg2.jpg</image>
<client>LeBoutique</client>
<title>Direct Mail Postcard</title>
<description>...</description>
</pic><pic>
<image>images/mmfront.jpg</image>
<client>M&amp;M's</client>
<title>Point-of-Purchase Display</title>
<description>...</description>
</pic><pic>
<image>images/mmtop.jpg</image>
<client>M&amp;M's</client>
<title>Point-of-Purchase Display</title>
<description>...</description>
</pic>
<pic>
<image>images/mmleft.jpg</image>
<client>M&amp;M's</client>
<title>Point-of-Purchase Display</title>
<description>...</description>
</pic>
<pic>
<image>images/mmright.jpg</image>
<client>M&amp;M's</client>
<title>Point-of-Purchase Display</title>
<description>...</description>
</pic>
<pic>
<image>images/blueskypkg.jpg</image>
<client>Blue Sky</client>
<title>Blue Sky Press Kit</title>
<description>...</description>
</pic>
</images>


Here is the action script (v2.0):



function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
client =[];
ttl = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
client[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
ttl[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portfolio.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;

} 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);
client_txt.htmlText = client[p];
ttl_txt.htmlText = ttl[p];
desc_txt.htmlText = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
client_txt.htmlText = client[p];
ttl_txt.htmlText = ttl[p];
desc_txt.htmlText = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
client_txt.htmlText = client[0];
ttl_txt.htmlText = ttl[0];
desc_txt.htmlText = description[0];
picture_num();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" of "+total+" projects";

}


What am I missing??

Medyman
09-29-2008, 01:01 AM
The images that are getting caught up (slide 1, slide 9, etc...) are doing so because the images aren't accessible at the path expressed in the XML.

http://www.stephaniedeis.com/images/skdlogo.gif
http://www.stephaniedeis.com/images/gazingballsmall.jpg

That's the root cause of your problem. The weird acting next/prev button have to do with the order in which variables are updated. That shouldn't be a problem if your image paths are correct.

parodeis
09-29-2008, 07:20 PM
hmm...I thought I checked that, but I'll check it again. Thanks! It's always helpful to have a fresh pair of eyes on the problem, cause I can stare at the thing for hours and miss a detail that's right in front of me. Thanks again!

Medyman
09-29-2008, 10:50 PM
hmm...I thought I checked that, but I'll check it again. Thanks! It's always helpful to have a fresh pair of eyes on the problem, cause I can stare at the thing for hours and miss a detail that's right in front of me. Thanks again!

lol...I know what you mean. I do that all the time.