# Components-ComboBox

**URL:** <https://forum.kirupa.com/t/components-combobox/578>\
**Category:** flash\
**Created:** [July 23, 2002, 6:37am UTC](https://forum.kirupa.com/t/components-combobox/578 "2002-07-23T06:37:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![niisa](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@niisa](https://forum.kirupa.com/u/niisa)\
**Post date:** [July 23, 2002, 6:37am UTC](https://forum.kirupa.com/t/components-combobox/578/1 "2002-07-23T06:37:53Z")

</div>

What is wrong with this code…  
I am using combobox but when I change selection it does not chnage to degree=5 or 6 or 7, which means my var direction does not change to southwest.

function getResults() {  
degree = combo\_box.getSelectedItem().data;  
selectedItem = combo\_box.getSelectedIndex();  
if (degree=1 or 2 or 3) {  
direction = “south”;  
} else if (degree=5 or 6 or 7) {  
direction = “southwest”;  
}  
}

Help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2002, 5:20pm UTC](https://forum.kirupa.com/t/components-combobox/578/2 "2002-07-23T17:20:07Z")

</div>

Here’s my version. If you need the quick fla, let me know here, and I will attach.

please note that I am using combo\_box.getvalue() instead of combo\_box.getSeletectedItem().data

also, I used \>= \<= instead of what you used

finally, my function name happens to be OnChange, but it can be anything you want to call it.

```auto

function onChange(combo_box) { 
degree = combo_box.getvalue(); 
if (degree<=4) { 
direction = "south"; 
} else if (degree>=5) { 
direction = "southwest"; 
} 
} 

```

good luck!
