# Hyperlinks in list boxes

**URL:** <https://forum.kirupa.com/t/hyperlinks-in-list-boxes/56808>\
**Category:** flash\
**Created:** [July 7, 2004, 9:52pm UTC](https://forum.kirupa.com/t/hyperlinks-in-list-boxes/56808 "2004-07-07T21:52:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamsterboy](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hamsterboy](https://forum.kirupa.com/u/hamsterboy)\
**Post date:** [July 7, 2004, 9:52pm UTC](https://forum.kirupa.com/t/hyperlinks-in-list-boxes/56808/1 "2004-07-07T21:52:42Z")

</div>

this is probably a very easy one, but I can’t find an answer anywhere.

how do I dynamically add a hyperlink to a listbox or combobox.

I’m new to components so please make the answer simple!!!

---

<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 7, 2004, 10:25pm UTC](https://forum.kirupa.com/t/hyperlinks-in-list-boxes/56808/2 "2004-07-07T22:25:32Z")

</div>

Assuming you have your listbox on the main stage with an instance name of “myListBox”.

place this code in an empty keyframe

```auto

// create the items
var item1 = {label: "Kirupa", data: www.digitalosophy.com};
var item2 = {label: "Google", data: www.google.com};
var item3 = {label: "Yahoo", data: www.yahoo.com};

// populate the list box
myListBox.addItem(item1);
myListBox.addItem(item2);
myListBox.addItem(item3);
           
// listener
myListBoxListener = new Object();
myListBoxListener.change = function ( eventObj )
{
    var eventSource = eventObj.target;
           
    var theSelectedItem = eventSource.selectedItem;
    var theSelectedItemLabel = theSelectedItem.label;
    var theSelectedItemData = theSelectedItem.data;
           
    getURL("http://" + theSelectedItemLabel);
}
           
myListBox.addEventListener ("change", myListBoxListener);

```

The checkbox is basically the same thing.
