# comboBox.selectedIndex using its data variable

**URL:** <https://forum.kirupa.com/t/combobox-selectedindex-using-its-data-variable/242747>\
**Category:** flash\
**Created:** [October 30, 2007, 12:38am UTC](https://forum.kirupa.com/t/combobox-selectedindex-using-its-data-variable/242747 "2007-10-30T00:38:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [October 30, 2007, 12:38am UTC](https://forum.kirupa.com/t/combobox-selectedindex-using-its-data-variable/242747/1 "2007-10-30T00:38:27Z")

</div>

I am building a PHP MySQL membership system in flash. I am working on the edit profile section right now. I can get all the users data to populate fine except for the combo Box. I know it would be comboBox.selectedIndex = state; (its a list of states).

The data variable that is stored in MySQL would be CA, which is the data variable for california

state\_cb.addItem({data:“CA”, label:“California”});

Is there a way to make selectedIndex = state…state being CA?
