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.

  1. Start a new ActionScript3 movie and save it as links.fla.
  2. From the menu select Window, Components. In the components window drag a ComboBox component to the stage.
  3. Open the property window and name the ComboBox cboLinks.
The array websites is enclosed inside a pair of brackets: []. Each item in the array consists of a label and data inside braces: {} Check your format carefully!
Get Adobe Flash player
The code is shown below:
import fl.controls.List; 

var websites: Array = [
    {label:"Yahoo", data:""},
    {label:"Google", data:""},
    {label:"Hello-World", data:""},
	{label:"Zebra0", data:""}
  ]; //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 =; //Retrieves data part from array
   navigateToURL(site); //Flash function to navigate to a webpage
} //linktoPage
Download the movie

NEXT: Radio Buttons