I’m loading content through an XML file.
Most of the content is working correctly. Flash is creating buttons based on some of the content in the XML file, the rest of the content in the XML file is static text and images.
Everything at first loads fine, the buttons all work, they change the text values but for the life of me I can’t figure out why its not changing the image. Any help would be appreciated.
I tried to create a function to remove the first image then load the new one but that didn’t work. My AS knowledge isn’t that great, I’m still learning
function DisplayInfo() {
clientwork.txtclient.text = this.client_text;
clientwork.txtlink.htmlText = this.link_text;
clientwork.txtdesc.htmlText = this.desc_text;
imageload();
}
function imageload() {
mcImage.con_image.removeMovieClip();
mcImage.con_image.loadMovie(image.firstChild.nodeValue, this.getNextHighestDepth());
}
var item_spacing = 13;
var item_count = 0;
function CreateMenu(menu_xml) {
var items = menu_xml.firstChild.firstChild.childNodes;
for (var i = 0; i<items.length; i++) {
var heading = items*.childNodes[0];
var title = items*.childNodes[1];
var link = items*.childNodes[2];
var desc = items*.childNodes[3];
var image = items*.childNodes[4];
var item_mc = clientlist.attachMovie("client_list", "item"+item_count, item_count);
item_mc._y = item_count*item_spacing;
item_count++;
mcImage.createEmptyMovieClip("con_image", this.getNextHighestDepth());
mcImage.con_image.loadMovie(items[0].childNodes[4].firstChild.nodeValue, this.getNextHighestDepth());
clientwork.txtclient.text = items[0].childNodes[1].firstChild.nodeValue;
clientwork.txtlink.htmlText = items[0].childNodes[2].firstChild.nodeValue;
clientwork.txtdesc.htmlText = items[0].childNodes[3].firstChild.nodeValue;
item_mc.txtclient.text = heading.firstChild.nodeValue;
item_mc.main_btn.client_text = title.firstChild.nodeValue;
item_mc.main_btn.link_text = link.firstChild.nodeValue;
item_mc.main_btn.desc_text = desc.firstChild.nodeValue;
item_mc.main_btn.onPress = DisplayInfo;
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
if (success) {
CreateMenu(this);
}
};
portfolio_xml.load("portfolio.xml");
//Image preloader function
this.onEnterFrame = function() {
imagesize = this.mcImage.con_image.getBytesTotal();
imageloaded = this.mcImage.con_image.getBytesLoaded();
this.preimage._visible = true;
if (imageloaded != imagesize) {
this.mcImage._alpha = 0;
this.preimage.loader._xscale = 99*imageloaded/imagesize;
} else {
this.preimage._visible = false;
if (this.mcImage._alpha<100) {
this.mcImage._alpha += 2;
}
}
function imagecheck() {
if (imageloaded != imagesize) {
this.mcImage._alpha = 0;
this.preimage.loader._xscale = 99*imageloaded/imagesize;
} else {
this.preimage._visible = false;
if (this.mcImage._alpha<100) {
this.mcImage._alpha += 2;
}
}
}
setInterval(imagecheck, 1000);
};