# Help with Combobox selections in AS 2

**URL:** https://forum.kirupa.com/t/help-with-combobox-selections-in-as-2/327850
**Category:** flash
**Created:** [April 1, 2012, 1:31pm UTC](https://forum.kirupa.com/t/help-with-combobox-selections-in-as-2/327850 "2012-04-01T13:31:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jatintalwar](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jatintalwar](https://forum.kirupa.com/u/jatintalwar)
#### Post date: [April 1, 2012, 1:31pm UTC](https://forum.kirupa.com/t/help-with-combobox-selections-in-as-2/327850/1 "2012-04-01T13:31:56Z")

</div>

Guys  
Had been working around with a combobox for setting the delaytime of my image slideshow .  
I had been trying this code :

```auto

my_cb.addItem({data:2, label:"Delay"});
my_cb.addItem({data:4, label:"4 Seconds"});
my_cb.addItem({data:6, label:"6 Seconds"});
my_cb.addItem({data:8, label:"8 Seconds"});
my_cb.addItem({data:10, label:"10 Seconds"});
var delayseconds;

my_cb.selectedIndex = my_cb.selectedItem;
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object):Void{

var currentlySelected:Object = evt_obj.target.selectedItem;
delayseconds = currentlySelected.data;
_global.delaytime=delayseconds;

};
my_cb.addEventListener("change", cbListener);

```

The combobox gets built up and outputs the delaytime values as desired ( have set it to \_global)

Now I want that the value of \_global.delaytime variable to be set to a default value unless the combobox is used which changes it to a new \_global.delaytimg value …So that the slideshow delaytime values can be changed by viewer .  
I have tried setting the value before the " function(evt\_obj:Object):Void{ " …but the new value doesnt replace the old one .  
Any helps will be highly appreciated .  
Thanks for ur time to read the post …Replies awaited

Regards  
Dr.Jatin Talwar
