# Can't get combobox.value

**URL:** <https://forum.kirupa.com/t/cant-get-combobox-value/295205>\
**Category:** flash\
**Created:** [August 26, 2009, 3:53pm UTC](https://forum.kirupa.com/t/cant-get-combobox-value/295205 "2009-08-26T15:53:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tedri\_Mark](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@Tedri\_Mark](https://forum.kirupa.com/u/Tedri_Mark)\
**Post date:** [August 26, 2009, 3:53pm UTC](https://forum.kirupa.com/t/cant-get-combobox-value/295205/1 "2009-08-26T15:53:12Z")

</div>

Hi there,

quite a simple problem I’m sure, but I can’t for the life of me get it to work.

I have made a placed a combobox called ‘genreselect’ on the stage and I am trying to output genreselect.value to a dynamic textbox called ‘output’ but I get the following error:

> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at fl.controls::ComboBox/get value()  
> at cataloguemenu\_fla::MainTimeline/cataloguemenu\_fla::frame1()

Here is the AS:

```auto
import fl.data.DataProvider;
import fl.events.ComponentEvent;

var items:Array = [
{label:"Choose Genre", data:"ignore"},
{label:"Action", data:"screenData1"},
{label:"Antipodes", data:"screenData2"},
{label:"Children", data:"screenData3"},
{label:"Classic English", data:"screenData4"},
{label:"Classic Erotica", data:"screenData5"},
{label:"Comedy", data:"Comedy"},
{label:"Documentary", data:"Documentary"},
{label:"Drama", data:"Drama"},
{label:"Eighties Classics", data:"Eighties Classics"},
{label:"Gangster", data:"Gangster"},
{label:"Girl's Night In", data:"Girl's Night In"},
{label:"Godfrey Ho", data:"Godfrey Ho"},
{label:"East Asia", data:"East Asia"},
{label:"Horror", data:"Horror"},
{label:"Independent,Auteur,Cult", data:"Independent,Auteur,Cult"},
{label:"Kids", data:"Kids"},
{label:"Oldies", data:"Oldies"},
{label:"Rest of the world", data:"Rest of the world"},
{label:"Sci-Fi and Fantasy", data:"Sci-Fi and Fantasy"},
{label:"Seventies America", data:""},
{label:"Singing and Dancing", data:"Singing and Dancing"},
{label:"Television", data:"Television"},
{label:"Thriller", data:"Thriller"},
{label:"Trash", data:"Trash"},
{label:"UK Independent", data:"UK Independent"},
{label:"War", data:"War"},
{label:"Western", data:"Western"},
{label:"Woody Allen", data:"Woody Allen"},
{label:"World Greats", data:"World Greats"},
];

genreselect.dataProvider = new DataProvider(items);

var myFormat:TextFormat=new TextFormat()
//myFormat.size=14;
myFormat.color=0xFF0000

genreselect.textField.setStyle("textFormat",myFormat)
genreselect.dropdown.setRendererStyle("textFormat",myFormat)

//if (genreselect.value !="ignore")
    output.text = genreselect.value
    //trace (genreselect.value)

```

As you can see I tried to trace genreselect.value and had the same result.

Can anyone help?
