Copy link to clipboard
Copied
Hi All...
I created a comboBox(Using the one in Component/Flash). I am unable to make the texts in DropDown menu to be shown in MULTILINE.
I have tried larger Row Heights and smaller texts so the issue is related to something else.
I found this piece of code searching in archive discussions "TextInput(aCb.getChildAt(1)).textField.multiline=true;"
not sure if it helps me in this problem or not...please let me know if you have a solution.
thanks
________________Action Script Code_____________________
import fl.data.DataProvider;
import fl.events.ComponentEvent;
import fl.controls.TextInput;
var myFormatBeige:TextFormat = new TextFormat();
myFormatBeige.font = "Arial";
myFormatBeige.size = 15;
myFormatBeige.color = 666666;
aCb.textField.setStyle("textFormat", myFormatBeige)
aCb.dropdown.setRendererStyle("textFormat", myFormatBeige);
var items:Array = [
{label:"o", data:"screenData1"},
{label:"I j", data:"screenData2"},
{label:"A", data:"screenData3"},
{label:"I ", data:"screenData4"},
{label:"C", data:"screenData5"},
{label:"A", data:"screenData6"}
];
aCb.dataProvider = new DataProvider(items);
aCb.addEventListener(ComponentEvent.ENTER, onAddItem);
function onAddItem(event:ComponentEvent):void
{
var newRow:int = 0;
if (event.target.text == "Add")
{
newRow = event.target.length + 1;
event.target.addItemAt({label:"screen" + newRow, data:"screenData" + newRow},
event.target.length);
}
}
TextInput(aCb.getChildAt(1)).textField.multiline=true;
TextInput(aCb.getChildAt(1)).textField.wordWrap=true;
aCb.dropdown.rowHeight = 90
Copy link to clipboard
Copied
By the way, I purposely put single letters for Labels to simplify the code for discussion only, the actual label of course exceeds a single line.
Copy link to clipboard
Copied
I played with it for a short time and found that adding...
TextInput(aCb.getChildAt(1)).textField.autoSize=TextFieldAutoSize.LEFT;
to the other two lines you have makes the textField go multine, however, the textfield that is being targeted by that is the one that displays in the top of the component. The textfields that drop down are within a List component. So you'll probably have to see if you can gain access to those and try the same.
Copy link to clipboard
Copied
Thanks....let me do more research and try to access the dropdown textfields.