Reload loaded file

file = new LoadVars();
file.onLoad = function() {
for (var i in file) {
n++;
list = i.split("|");
combobox.addItem("song “+n+” "+list[0], list[1]);
}
};
file.load(“http://www.file.asp”);
onChange = function () { screen.loadSound(combobox.getSelectedItem().data, true);};
function populate() {
combobox.removeall();
combobox.addItem(file);???
}

I am trying to repopulate the combobox with the already loaded asp file. I have tried many other ways and all have failed. Any pointers would be great.

hey waffe… Are you really trying to populate the combobox on Change? If you’re not, populate the combo box inside of the onload command. I ran into a similar dilemma the other day.

:slight_smile:

No, I am not trying to populate the combobox onChange.
So where exactly would I put the populate command?

file = new LoadVars();
file.onLoad = function() {
for (var i in file) {
n++;
list = i.split("|");
combobox.addItem("Read profile “+n+” "+list[0], list[1]);
function populate() {
combobox.removeall();
combobox.addItem();
}
}
};
file.load(“http://www.voicezam.com/audition_results.asp”);
onChange = function () { screen.loadSound(combobox.getSelectedItem().data, true);};

I hope it is not because the button with the on populate command does not work.

:q:

that is kind of it… you dont really need the function called populate, you could really populate your combo box without it. Let me give it a whirl and I’ll come back with an educated answer.

From what I can see… the populate function in your description will immediately delete what you have added with the first combobox.additem…

Also, if you want to be able to access populate(), put it in frame of the timeline. If you nest it inside another function, Im pretty sure it is only available inside of that function. I hope that makes sense.

OK, I believe I know what you’re talking about but if you look at my original question I am looking to repopulate my combobox with my already loaded asp file. When I 1st load the move everything works great. I have a trash button that removes 1 item of the list box. I also have a reload button that will reload my already been loaded asp file.

I have put a second frame on my move so I can reload the original code GoToAndPlay 2 which takes me back to frame 1.

The combobox reloads but the loop is incorrect.

Any Thoughts?

You where correct when you said I did not need to populate.

I made n = 0 and reloaded the 1st frame of my movie to reload my combobox?

All good hear><