Hi fellow kirupians.=)
What im trying to is switch bewteen different urls. i have data being pulled in via php file which outputs it as XML and it loads the text and image data. but i want a button to load/switch to a different url for it to load.
[COLOR=#003366]its the “guytees” that i want to swap to “girltees”[/COLOR]
[COLOR=#003366]Any help thanks.[/COLOR]
my code:
var thumb_spacing = 82;
// load variables object to handle loading of text
var myData = new LoadVars();
myData.onData = function(ok) {
if (ok) {
title_txt.text = this.title;
code_txt.text = this.code;
sizes_txt.text = this.sizes;
fabric_txt.text = this.fabric;
fit_txt.text = this.fit;
price_txt.text = this.price;
//description_txt.text = raw_text;
} else {
trace("Error Loading Data");
}
};
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures*;
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = i%3*thumb_spacing;
currentThumb_mc._y = Math.floor(i/3)*101;
currentThumb_mc.createEmptyMovieClip("thumb_container", 0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.code = currentPicture.attributes.code;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.sizes = currentPicture.attributes.sizes;
currentThumb_mc.fabric = currentPicture.attributes.fabric;
currentThumb_mc.fit = currentPicture.attributes.fit;
currentThumb_mc.price = currentPicture.attributes.price;
/*currentThumb_mc.onRollOver = currentThumb_mc.onDragOver=function () {
info_txt.text = this.title;
};
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut=function () {
info_txt.text = "";
};*/
currentThumb_mc.onRelease = function() {
image_mc.loadMovie(this.image);
title_txt.text = this.title.toUpperCase();
code_txt.text = this.code.toUpperCase();
sizes_txt.text = this.sizes;
fabric_txt.text = this.fabric;
fit_txt.text = this.fit;
price_txt.text = this.price;
};
}
}
// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
if (success) {
GeneratePortfolio(this);
} else {
trace("Error loading XML file");
}
// no success? trace error (wont be seen on web)
};
// load
phpfileload = "../apparel.php?prodCategory=guytees";
portfolio_xml.load(phpfileload);