# Combo Box Problems

**URL:** <https://forum.kirupa.com/t/combo-box-problems/321904>\
**Category:** flash\
**Created:** [May 4, 2011, 3:02pm UTC](https://forum.kirupa.com/t/combo-box-problems/321904 "2011-05-04T15:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [May 4, 2011, 3:02pm UTC](https://forum.kirupa.com/t/combo-box-problems/321904/1 "2011-05-04T15:02:09Z")

</div>

I have this combo box below but if the user does not make a selection I get this error.

TypeError: Error #1009: Cannot access a property or method of a null object reference at MethodInfo-390()

```auto

/ *****Set up the drop-down menu.****************************************** /
 var mcAttribute1:mcAttributes = new mcAttributes();
 mcAttribute1.name="mcAttribute1";
 mcAttribute1.x=mcAttribute1.y=16;
 mcAttribute1.comboAttribute.prompt="Choose";
 mcAttribute1.comboAttribute.addItem({label:"0", data:0});
 mcAttribute1.comboAttribute.addItem({label:"2", data:2});
 mcAttribute1.comboAttribute.addItem({label:"3", data:3});
 mcAttribute1.comboAttribute.addItem({label:"4", data:4});
 mcAttribute1.btnSubmitFile.addEventListener(MouseEvent.CLICK, handleSubmitFile);
 this.addChild(mcAttribute1);
 function handleSubmitFile(evt:Event):void
 {
  handleCheckDuplicate(mcAttribute1.txtAttribute.text);
  var numberChoices:uint = mcAttribute1.comboAttribute.selectedItem.data;
  
  trace(mcAttribute1.comboAttribute.selectedItem.data);
  if (mcAttribute1.txtAttribute.text != "" && [COLOR=darkred]mcAttribute1.comboAttribute.selectedIndex != -1[/COLOR])

```
