# Accessing value of a listbox from other frame

**URL:** <https://forum.kirupa.com/t/accessing-value-of-a-listbox-from-other-frame/164875>\
**Category:** flash\
**Created:** [October 5, 2005, 6:16pm UTC](https://forum.kirupa.com/t/accessing-value-of-a-listbox-from-other-frame/164875 "2005-10-05T18:16:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superprg](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@superprg](https://forum.kirupa.com/u/superprg)\
**Post date:** [October 5, 2005, 6:16pm UTC](https://forum.kirupa.com/t/accessing-value-of-a-listbox-from-other-frame/164875/1 "2005-10-05T18:16:34Z")

</div>

I have this code in my frame which dynamically makes a listbox with the name of all days in it

this.attachMovie(“FComboBoxSymbol”, “myList”, 1, {\_x:100, \_y:100});  
myData =[“Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”];  
for(var i=0; i\<myData.length; i++) myList.addItem(myData\*);  
myList.setChangeHandler(“show”);  
function show(obj){  
var selected = obj.getSelectedItem().label  
trace(selected)  
//Your code to use the selected value  
}

Now I kept one push button in other frame and kept in the action part

on(click)  
{  
trace(myList.getselectedItem().Label);  
trace(myData[2]);

}  
but I am not getting any output  
How can I access variables from other frame.  
Thanks

PS: Also, the line List.setChangeHandler(show(List)); doesnt seems to work
