In the next example, instead of setting the data bindings for the combo box in the Component Inspector, we set them using ActionScript. This movie displays a list of websites and links to them when one is clicked.
import fl.controls.List;
import fl.data.DataProvider;
var websites: Array = [
{label:"Yahoo", data:"http://www.yahoo.com"},
{label:"Google", data:"http://www.google.com"},
{label:"Hello-World", data:"http://www.hello-world.com"},
{label:"Zebra0", data:"http://www.zebra0.com"}
]; //list of websites and link
cboLinks.dataProvider = new DataProvider(websites);
cboLinks.addEventListener(Event.CHANGE, linktoPage);
function linktoPage(event:Event):void {
var site: URLRequest = new URLRequest();
site.url = cboLinks.selectedItem.data; //Retrieves data part from array
navigateToURL(site); //Flash function to navigate to a webpage
} //linktoPage
Download the movie