Actionscript 1 - help
- Started
- Last post
- 3 Responses
- fixate
I have a listbox which is being prepolated by an xml file.
it's getting the value of each "category" tag within a "link" tag.
How do I check to see if a category has already been used as I loop through.
Because at the moment I can loop through and fill the listbox with all the categories, but i have nothing to say.." if category is already in the listbox, don't use it again".
Hope i made sense... and hope to gawd someone knows how to do this.
Thanks,
- BZZZP0
an exceedingly dirty way to do this would be to keep a var to which you append the cat name with a sertain separator, then do
if(hypotheticalVar.indexOf(sep.n...
// show cat
}... or, you can do the same kind of dirty hack in a slightly cleaner fashion by populating a catName-named array with, say 1s - like this:
//in the beginning
var checkCat = Array();//in loop
if(checkCat[newCat]==1){
// don't show
}else{
//show
checkCat[newCat] = 1;
}not 100% on the syntax cuz i've been in PHP not AS all day.
hth
- BZZZP0
PVN desperately needs ubb-style [code] tags...
- heavyt0
not sure if this will help, but if the XML is in an array, you can check the length of the array right after it loads.
then you can tell it where to stop.
ex.
testVarLength = array.length;that may or may not be of any use.
TR1