Hi there,
I have a flash movie with vertical static buttons. when one of the static buttons are clicked on the buttons below slide down and a xml nav is loaded in. This works well till i click on another static button. for some reason the xml nav sits on the very top of every thing. Is there some way to get it so it goes under the static nav or dissapear all to gether when another static button is selected?
the code below loads in the xml and creates the nav
//
//hide the original button
this.button_mc._visible = false;
//set the starting Y position from the first button
Ystart = this.button_mc._y;
//
//create the Array
files = new Array();
cont_head = new Array();
cont_txt = new Array();
//
//create the XML
var XMLreciever = new XML();
XMLreciever.ignoreWhite = true;
//onLoad Function
XMLreciever.onLoad = function(success:Boolean) {
if (success) {
//loop thru the <buttons> nodes in the XML
for (i=0; i<this.firstChild.childNodes.length; i++) {
//enter the current name attribute of the <buttons> node into the files array
files* = this.firstChild.childNodes*.attributes.name;
cont_head* = this.firstChild.childNodes*.childNodes[5].firstChild.nodeValue;
cont_txt* = this.firstChild.childNodes*.childNodes[6].firstChild.nodeValue;
//
//duplicate the button on the stage
duplicateMovieClip(_root.button_mc, "button_"+i, i);
//set the Y position of the new button
_root["button_"+i]._y = Ystart;
//Incremement the Ystart variable for the next button
Ystart += 20.8;
//set the text on the button
_root["button_"+i].textbox.text = files*;
//set the image variables
_root["button_"+i].image1_xml = this.firstChild.childNodes*.childNodes[0].firstChild.nodeValue;
_root["button_"+i].image2_xml = this.firstChild.childNodes*.childNodes[1].firstChild.nodeValue;
_root["button_"+i].image3_xml = this.firstChild.childNodes*.childNodes[2].firstChild.nodeValue;
_root["button_"+i].image4_xml = this.firstChild.childNodes*.childNodes[3].firstChild.nodeValue;
_root["button_"+i].image5_xml = this.firstChild.childNodes*.childNodes[4].firstChild.nodeValue;
_root["button_"+i].content_heading_xml = this.firstChild.childNodes*.childNodes[5].firstChild.nodeValue;
_root["button_"+i].content_text_xml = this.firstChild.childNodes*.childNodes[6].firstChild.nodeValue;
_root["button_"+i].visit_link_xml = this.firstChild.childNodes*.childNodes[7].firstChild.nodeValue;
}
//setting loaders
ran_num=Math.floor(Math.random()*this.firstChild.childNodes.length);
image1 = this.firstChild.childNodes[ran_num].childNodes[0].firstChild.nodeValue;
image2 = this.firstChild.childNodes[ran_num].childNodes[1].firstChild.nodeValue;
image3 = this.firstChild.childNodes[ran_num].childNodes[2].firstChild.nodeValue;
image4 = this.firstChild.childNodes[ran_num].childNodes[3].firstChild.nodeValue;
image5 = this.firstChild.childNodes[ran_num].childNodes[4].firstChild.nodeValue;
content_heading.text = this.firstChild.childNodes[ran_num].childNodes[5].firstChild.nodeValue;
content_text.text = this.firstChild.childNodes[ran_num].childNodes[6].firstChild.nodeValue;
visit_link = this.firstChild.childNodes[ran_num].childNodes[7].firstChild.nodeValue;
_root.image_loader.contentPath = "images/flash_images/"+this.firstChild.childNodes[ran_num].childNodes[0].firstChild.nodeValue;
}
};
//load xml file
XMLreciever.load("images/images.xml");
//scrolling script
function scrup(){
content_text.scroll=content_text.scroll-1;
}
function scrdown(){
content_text.scroll=content_text.scroll+1;
}
thanks for you help