• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ComboBox::Getting text to be shown in Multiline.

New Here ,
Apr 12, 2012 Apr 12, 2012

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

TOPICS
ActionScript

Views

869

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2012 Apr 12, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 12, 2012 Apr 12, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2012 Apr 12, 2012

Copy link to clipboard

Copied

LATEST

Thanks....let me do more research and try to access the dropdown textfields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines