# Cannot fill combobox

**URL:** <https://forum.kirupa.com/t/cannot-fill-combobox/294978>\
**Category:** flash\
**Created:** [August 23, 2009, 7:52pm UTC](https://forum.kirupa.com/t/cannot-fill-combobox/294978 "2009-08-23T19:52:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KillinSprE](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@KillinSprE](https://forum.kirupa.com/u/KillinSprE)\
**Post date:** [August 23, 2009, 7:52pm UTC](https://forum.kirupa.com/t/cannot-fill-combobox/294978/1 "2009-08-23T19:52:07Z")

</div>

I have a main SWF that loads an external SWF with addChild. the external SWF loads fine but when i click the combobox in the external SWF I get 2 errors:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.display::DisplayObjectContainer/removeChild()  
at fl.controls::ComboBox/close()  
at fl.controls::ComboBox/focusOutHandler()

and

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at fl.containers::BaseScrollPane/drawBackground()  
at fl.controls::List/draw()  
at fl.core::UIComponent/drawNow()  
at fl.controls::List/scrollToIndex()  
at fl.controls::SelectableList/scrollToSelected()  
at fl.controls::ComboBox/open()  
at fl.controls::ComboBox/onToggleListVisibility()

These errors only show up when I try to run the site once its uploaded.

running main by testing movie in CS4…external SWF runs perfect  
running external SWF by testing movie in CS4… runs perfectly  
running external SWF once uploaded… runs perfectly  
running main after uploading…external movie runs proper until you click on the ComboBox then i get the errors

this is the part of the code casuing me issues. If I comment the line inside the {} I get zero errors:

for (var i:uint=0; i\<evt.target.data.cant; i++) {  
city.addItem({label: evt.target.data[“city”+i],data: evt.target.data[“city”+i]});  
}

Please help.
