# Combobox with wrapping text

**URL:** <https://forum.kirupa.com/t/combobox-with-wrapping-text/266365>\
**Category:** Uncategorized\
**Created:** [July 18, 2008, 9:44pm UTC](https://forum.kirupa.com/t/combobox-with-wrapping-text/266365 "2008-07-18T21:44:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylviamc](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sylviamc](https://forum.kirupa.com/u/sylviamc)\
**Post date:** [July 18, 2008, 9:44pm UTC](https://forum.kirupa.com/t/combobox-with-wrapping-text/266365/1 "2008-07-18T21:44:42Z")

</div>

Hi folks,

I have working on this all day. I finally figured out how to make text wrap in a combobox but now my links aren’t working and I can’t figure out what to do next. I know the problem is in my eventlistener.

The full instructions for how to do this Multiline combobox are available here.  
[http://livedocs.adobe.com/flash/mx2004/main\_7\_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash\_MX\_2004&file=00002101.html](http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00002101.html)

Thanks for the help.  
Sylvia

//my code for the combobox page starts here  
import mx.transitions._;  
import mx.transitions.easing._;  
import mx.controls.\*;

//style combo box  
import mx.styles.CSSStyleDeclaration;  
var new\_style:Object = new CSSStyleDeclaration();  
\_global.styles.myStyle = new\_style;  
\_global.style.setStyle(“RollOverColor”, 0xB3E6DC);

new\_style.setStyle(“textAlign”, “left”);  
new\_style.setStyle(“selectionColor”, 0xB3E6DC);  
new\_style.setStyle(“useRollOver”, true);  
// borderStyle from RectBorder class  
new\_style.setStyle(“borderStyle”, “none”);  
new\_style.setStyle(“openDuration”, 600);  
new\_style.setStyle(“openEasing”, Back.easeOut);  
myCombobox.setStyle(“styleName”, “myStyle”);

//fill combo box  
var myCombobox:ComboBox;  
var dataArr:Array = new Array({data:“1”, label:“Click Here to Select Lesson”}, {data:“2”, label:“Lesson 0 About This Course”}, {data:“3”, label:“Lesson 1 Introduction to EAs”}, {data:“4”, label:“Lesson 2 Legislation Governing EAs”}, {data:“5”, label:“Lesson 3 EA Process”}, {data:“6”, label:“Lesson 4 Describe Project & Define Environment”}, {data:“6”, label:“Lesson 5 Predict Environmental Effects”}, {data:“8”, label:“Lesson 6 Determine Environmental Effects & Make Decisions”}, {data:“9”, label:“Lesson 7 Implement & Follow Up”}, {data:“10”, label:“Lesson 8 Roles & Responsibilities”}, {data:“11”, label:“Lesson 9 Course Summary”});  
myCombobox.removeAll();  
myCombobox.dropdown.rowHeight = 40;  
//For DropDown Font Change  
myCombobox.dropdown.cellRenderer = “MultiLineCell”;  
myCombobox.dataProvider = dataArr;

myComboBoxListener.change = function(eventObj) {  
var eventSource = eventObj.target;  
var theSelectedItem = eventSource.selectedItem;

```
var theSelectedItemLabel = theSelectedItem.label;
msg = "You selected "+theSelectedItemLabel+".";
statusMessage.text = msg;
if (theSelectedItemLabel == "Click Here to Select Lesson") {
	trace("click here");
}
if (theSelectedItemLabel == "Lesson 0 About This Course") {
	this.gotoAndPlay("A1_expanded");
	trace("hit");
}
if (theSelectedItemLabel == "Lesson 1 Introduction to EAs") {
	this.gotoAndPlay("L1_expanded");
}
if (theSelectedItemLabel == "Lesson 2 Legislation Governing EAs") {
	this.gotoAndPlay("L2_expanded");
}
if (theSelectedItemLabel == "Lesson 3 EA Process") {
	this.gotoAndPlay("L3_expanded");
}
if (theSelectedItemLabel == "Lesson 4 Describe Project & Define Environment") {
	this.gotoAndPlay("L4_expanded");
}
if (theSelectedItemLabel == "Lesson 5 Predict Environmental Effects") {

	trace("5 hit finally");
	this.gotoAndPlay("L5_expanded");
	
}
if (theSelectedItemLabel == "Lesson 6 Determine Environmental Effects & Make Decisions") {
	this.gotoAndPlay("L6_expanded");
}
if (theSelectedItemLabel == "Lesson 7 Implement & Follow Up") {
	this.gotoAndPlay("L7_expanded");
}
if (theSelectedItemLabel == "Lesson 8 Roles & Responsibilities") {
	this.gotoAndPlay("L8_expanded");

}
if (theSelectedItemLabel == "Lesson 9 Course Summary") {
	this.gotoAndPlay("L9_expanded");

```

trace(“hit”);  
}  
};  
myComboBox.addEventListener(“change”, myComboBoxListener);  
this.stop();

//code ends here
