Hi there

Im working on a listbox(flash component), where upon click, will display other arrays in a movie( which is also a listbox made from textfield). The second listbox suppose to contain html links, where it will open up a popup upon clicked.

The problem is that whenever i click on the listbox, the content in the sub listbox doesn't change. that is, it doesnt empty the previous load of links, but just add on to the list of links.

Im not sure what i can use to prevent this issue. I have tried listener, and "if else" statements.. Im not sure what else can be done to prevent this.

I've include the codes for the 2nd listbox(the textfield listbox) Hope that helps better in the understanding of my queston.

Really appreciate any help. Thanks.

var ListListen:Object = new Object();
ListListen.change = function(pEvent:Object) {
   var selectItem:Object = pEvent.target.selectedItem;
var b :Object = pEvent.target.selectedIndex;
 sampleList =_root.sampleMovie.Slist
sampleList._visible = false;
  for (j=0; j<total; j++) { 
if (fTitle[b]== sampleTitle[j]) {
sampleList._visible = true;
 sampleList.htmlText  += "<A HREF='javascript:openNewWindow(" + sampleLinks[j] + ",myFlash,width=640,height=480,toolbar=no,resizable  =no)' target = '_blank'> " + sampleWorks[j]+ "</a><br>"
 sampleList.dataProvider = selectItem.data;
 
}
}
};

I am not "pro" in Flash but you may try to do following. After selection from main index been made ad an extra line in your code which will empty your listbox of main index (empty your string variable) and then load up sub index.

hm..
i need to have 2 listbox showing.. so that user uses the main lsitbox to open up whatever it is on the 2nd listbox aka textfield with scrolling buttons..

Same thing

At start your_subindex   = {empty string}
on 1st click your_subindex   = {1st subindex}
on 2nd click 1st command your_subindex   = {empty string}
2nd command your_subindex   = {2nd subindex}

and so on.

Also why dont you try classic on? All subindexes placed on the stage and make them invisible on start. Then when ever any selection made run small script which will make shore that others subindexes are hiden only requered is visible. In style of rollover, instead of rollover use command onclick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.