Having trouble with modified slideshow tutorial (shocking, I know)

Hi Everyone,

I’m stuck on a bit of actionscript… hopefully someone can help me out. :thumb:

I’m helping my GF create a site for her dad. It’s a simple site with five sections, each one containing an XML slideshow that was created with modified code from the [COLOR=#003366]**Photo **[FONT=Verdana][URL=“http://www.kirupa.com/developer/mx2004/xml_slideshow.htm”]Slideshow Using XML and Flash tut.[/FONT][/COLOR]

The in-progress site is temporarily hosted here: http://www.davengray.com/DG_siteKJ14.html

As you can see, everything works fine on the initial load. But if you navigate to one of the other sections (which are not yet complete), then try to get back to the first page (clicking on Home is supposed to work), all that is shown is a black box (used on the site to transition from one section to another).

As you can also see, this problem does not occur when navigating back and forth between sections 2-5.

I think I have the problem isolated to a conflict between the _alpha controls on the blackFader and picture_SEC1… but I have no idea why there is a conflict, and even less idea of how to solve it.

Thanks for any help you can give me!

:thumb2: :thumb2:

Kyle

 
stop();
//define and set current section variable
var w:Number = 1;
//define get section function
function getSection(){
  blackFader._alpha+=5;
  if(blackFader._alpha>100){
  blackFader._alpha=100;
   }
  if(blackFader._alpha==100){
  _root.gotoAndStop(w);
   _root.onEnterFrame=function(){
   blackFader._alpha-=5;
   if(blackFader._alpha<0){
   blackFader._alpha=0;
    }
   }
   }
  }
//home button
home_button.onRollOver = function() {
 this.gotoAndPlay("over");
}
home_button.onPress = function() {
 this.gotoAndPlay("up");
}
home_button.onRelease = function() {
 this.gotoAndPlay("up");
 w = 1;
 nav_selection_mc._x = (0);
 nav_selection_mc._width = (152.3);
 _root.onEnterFrame = getSection;
}
home_button.onRollOut = function() {
 this.gotoAndPlay("up");
}
////rockwork button
rockwork_button.onRollOver = function() {
 this.gotoAndPlay("over");
}
rockwork_button.onPress = function() {
 this.gotoAndPlay("up");
}
rockwork_button.onRelease = function() {
 this.gotoAndPlay("up");
 w = 2;
 nav_selection_mc._x = (152.3);
 nav_selection_mc._width = (175.8);
 _root.onEnterFrame = getSection;
}
rockwork_button.onRollOut = function() {
 this.gotoAndPlay("up");
}
//construction button
construction_button.onRollOver = function() {
 this.gotoAndPlay("over");
}
construction_button.onPress = function() {
 this.gotoAndPlay("up");
}
construction_button.onRelease = function() {
 this.gotoAndPlay("up");
 w = 3;
 nav_selection_mc._x = (328.1);
 nav_selection_mc._width = (175.8);
 _root.onEnterFrame = getSection;
}
construction_button.onRollOut = function() {
 this.gotoAndPlay("up");
}
//other button
other_button.onRollOver = function() {
 this.gotoAndPlay("over");
}
other_button.onPress = function() {
 this.gotoAndPlay("up");
}
other_button.onRelease = function() {
 this.gotoAndPlay("up");
 w = 4;
 nav_selection_mc._x = (503.6);
 nav_selection_mc._width = (175.1);
 _root.onEnterFrame = getSection;
}
other_button.onRollOut = function() {
 this.gotoAndPlay("up");
}
/////contact button
contact_button.onRollOver = function() {
 this.gotoAndPlay("over");
}
contact_button.onPress = function() {
 this.gotoAndPlay("up");
}
contact_button.onRelease = function() {
 this.gotoAndPlay("up");
 w = 5;
 //gotoAndPlay("contact");
 nav_selection_mc._x = (678.7);
 nav_selection_mc._width = (171.4);
 _root.onEnterFrame = getSection;
}
contact_button.onRollOut = function() {
 this.gotoAndPlay("up");
}
//section scripts
//continue button
continue_btn.onRollOver = function() {
 this.gotoAndPlay("over");
}
continue_btn.onPress = function() {
 this.gotoAndPlay("up");
}
continue_btn.onRelease = function() {
 this.gotoAndPlay("up");
 w = w+1;
 nav_selection_mc._x = (152.3);
 nav_selection_mc._width = (175.8);
 _root.onEnterFrame = getSection;
}
continue_btn.onRollOut = function() {
 this.gotoAndPlay("up");
}
//set slide show interval
delay_SEC1 = 5000;
//define load xml function
function loadXML_SEC1(loaded_SEC1) {
if (loaded_SEC1) {
xmlNode_SEC1 = this.firstChild;
image_SEC1 = [];
description_SEC1 = [];
total_SEC1 = xmlNode_SEC1.childNodes.length;
for (i_SEC1=0; i_SEC1<total_SEC1; i_SEC1++) {
image_SEC1[i_SEC1] = xmlNode_SEC1.childNodes[i_SEC1].childNodes[0].firstChild.nodeValue;
description_SEC1[i_SEC1] = xmlNode_SEC1.childNodes[i_SEC1].childNodes[1].firstChild.nodeValue;
}
firstImage_SEC1();
} else {
content = "file not loaded!";
}
}
xmlData_SEC1 = new XML();
xmlData_SEC1.ignoreWhite = true;
xmlData_SEC1.onLoad = loadXML_SEC1;
xmlData_SEC1.load("http://davengray.com/images.xml");
//set next, previous and back controls
listen_SEC1 = new Object();
listen_SEC1.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage_SEC1();
} else if (Key.getCode() == Key.RIGHT) {
 clearInterval(myInterval_SEC1);
 nextImage_SEC1();
}
};
Key.addListener(listen_SEC1);
previous_btn.onRelease = function() {
 prevImage_SEC1();
};
next_btn.onRelease = function() {
 clearInterval(myInterval_SEC1);
 nextImage_SEC1();
};
stop_btn.onRelease = function() {
 clearInterval(myInterval_SEC1);
};
//
p_SEC1 = 0;
//define preloader and picture fade
this.onEnterFrame = function() {
filesize_SEC1 = picture_SEC1.getBytesTotal();
loaded_SEC1 = picture_SEC1.getBytesLoaded();
preloader_SEC1._visible = true;
if (loaded_SEC1 != filesize_SEC1) {
preloader_SEC1.preload_bar_SEC1._xscale = 100*loaded_SEC1/filesize_SEC1;
} else {
preloader_SEC1._visible = false;
if (picture_SEC1._alpha<100) {
picture_SEC1._alpha += 10;
}
}
};
//define next image function
function nextImage_SEC1() {
if (p_SEC1<(total_SEC1-1)) {
p_SEC1++;
if (loaded_SEC1 == filesize_SEC1) {
picture_SEC1._alpha = 0;
picture_SEC1.loadMovie(image_SEC1[p_SEC1], 1);
desc_txt_SEC1.text = description_SEC1[p_SEC1];
picture_num_SEC1();
slideshow_SEC1();
}
}
}
//define previous image function
function prevImage_SEC1() {
if (p_SEC1>0) {
p_SEC1--;
picture_SEC1._alpha = 0;
picture_SEC1.loadMovie(image_SEC1[p_SEC1], 1);
desc_txt_SEC1.text = description_SEC1[p_SEC1];
picture_num_SEC1();
}
}
//define first image function
function firstImage_SEC1() {
if (loaded_SEC1 == filesize_SEC1) {
picture_SEC1._alpha = 0;
picture_SEC1.loadMovie(image_SEC1[0], 1);
desc_txt_SEC1.text = description_SEC1[0];
picture_num_SEC1();
slideshow_SEC1();
}
}
//define picture number function
function picture_num_SEC1() {
current_pos_SEC1 = p_SEC1+1;
pos_txt_SEC1.text = current_pos_SEC1+" / "+total_SEC1;
}
//define slideshow function
function slideshow_SEC1() {
myInterval_SEC1 = setInterval(pause_slideshow_SEC1, delay_SEC1);
function pause_slideshow_SEC1() {
clearInterval(myInterval_SEC1);
if (p_SEC1 == (total_SEC1-1)) {
p_SEC1 = 0;
firstImage_SEC1();
} else {
nextImage_SEC1();
}
}
}