hi
i ran into some trouble with arrays… wonder if anyone can guide me?
I suppose to load a xml into flash n convert it into an array. After which im suppose to place them in listbox so that ppl are able to select them to view different stuff.
Apparently, im unable to get the selected value of the listbox. With this, the users cannot select n the whole thing doesnt work.
With array, im suppose to use getSelectedItem to get the value… but it always ends up in a error “[type function]”
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("../XMLs/features_index.xml");
//////////////////////////////////////////////////////////////////
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
f_title = [];
tawards = [];
awards_img = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
f_title* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
image* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
tawards* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
awards_img* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
//trace(awards);
}
setupFeatureList();
firstImage();
prevImage();
nextImage();
} else {
content = "file not loaded!";
}
}
//////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 100;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
titleText.text = f_title[p];
awards_T.text = tawards[p];
awards.loadMovie(awards_img[p], 50);
picture_num();
}
}
}
////////////////////////////
function prevImage() {
if (p>0) {
p--;
picture._alpha = 100;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
titleText.text = f_title[p];
awards_T.text = tawards[p];
awards.loadMovie(awards_img[p], 1);
picture_num();
}
}
////////////////////////////
function firstImage() {
if (loaded == filesize) { picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
titleText.text = f_title[0];
awards_T.text = tawards[0];
awards.loadMovie(awards_img[0], 1);
picture_num();
}
}
///////////////////////////
function picture_num() {
current_pos = p+1;
status_txt.text = current_pos+total;
}
///////////////////////////
function setupFeatureList() {
for(var item in f_title){
featureList.addItem(f_title[item]);
trace(featureList.getSelectedItem);
}
}
thanks in advance