I am declaring the following function on the first frame of my movie and calling it from a button (on release) in the middle of the movie. The button also takes you to another frame where the Listbox (S2_listbox) doesn't exist. Everytime I do this the value is "undefined". How can this be if I am clearly defining the variable in the function?
Any help would be appreciated.


function Q2Listbox1() {
Listbox1 = S2_listbox.getSelectedItem().data;
trace(Listbox1);
trace(S2_listbox.getSelectedItem().data);
}