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()
/***** 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])