Hosting Solutions
mobile_logo Table of Contents

ComboBox Component Tutorial

In this Flash ActionScript 3.0 tutorial we show a dynamic example of how to populate drop down lists according to user selection. We show you how to access the value of what the user has chosen, and also how to clear a comboBox component of all of its list items. function carList():void { cb1.addItem( { label: "Ford Mustang" } ); cb1.addItem( { label: "Porsche 911" } ); cb1.addItem( { label: "Dodge Viper" } ); } function jacketList():void { cb1.addItem( { label: "Leather" } ); cb1.addItem( { label: "Sheepskin" } ); cb1.addItem( { label: "Wool" } ); } function carsBtnClick (event:MouseEvent):void { cb1.removeAll(); carList(); status_txt.text = "You clicked on the Cars button"; } function jacketsBtnClick (event:MouseEvent):void { cb1.removeAll(); jacketList(); status_txt.text = "You clicked on the Jackets button"; } cars_btn.addEventListener(MouseEvent.CLICK, carsBtnClick); jackets_btn.addEventListener(MouseEvent.CLICK, jacketsBtnClick); cb1.addEventListener(Event.CHANGE, displaySelection); function displaySelection (event:Event):void { status_txt.text = "You chose: " + cb1.selectedItem.label; }

Flash Videos

Component Programming

ScrollPane Component TutorialTextArea Component Tutorial 2TextArea Component TutorialSlider Component TutorialProgress Bar Component TutorialRadio Button Component TutorialUILoader Component TutorialNumeric Stepper Component TutorialList Component TutorialDataGrid Component TutorialComboBox Component TutorialColorPicker Component TutorialCheckBox Component TutorialButton Component TutorialCustom Slider Component Development