Highlighted

apply htmlText to ComboBox in Animate CC

New Here ,
Sep 21, 2018

Copy link to clipboard

Copied

I can handle  dropdown part using cell renderer, but not able to change the top selection part(combobox.textfield) to display HTML text. Is there any way to solve this problem?

cimage.png

myComboBox.addItem({label:t1.text});

myComboBox.addItem({label:t2.text});

myComboBox.addItem({label:t3.text});

myComboBox.addItem({label:t4.text});

myComboBox.dropdown.rowHeight = 40;

myComboBox.dropdown.setStyle("cellRenderer", dropDownCellRenderer);

addChild(myComboBox);

package {

import fl.controls.listClasses.CellRenderer;

public class dropDownCellRenderer extends CellRenderer {

     public function dropDownCellRenderer() {

          // constructor code

     }

     override protected function drawLayout():void {

          textField.htmlText = this.label;

          super.drawLayout();

     }

}

}

Regards,

Rikun Patel

TOPICS
Development

Views

185

Likes

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

apply htmlText to ComboBox in Animate CC

New Here ,
Sep 21, 2018

Copy link to clipboard

Copied

I can handle  dropdown part using cell renderer, but not able to change the top selection part(combobox.textfield) to display HTML text. Is there any way to solve this problem?

cimage.png

myComboBox.addItem({label:t1.text});

myComboBox.addItem({label:t2.text});

myComboBox.addItem({label:t3.text});

myComboBox.addItem({label:t4.text});

myComboBox.dropdown.rowHeight = 40;

myComboBox.dropdown.setStyle("cellRenderer", dropDownCellRenderer);

addChild(myComboBox);

package {

import fl.controls.listClasses.CellRenderer;

public class dropDownCellRenderer extends CellRenderer {

     public function dropDownCellRenderer() {

          // constructor code

     }

     override protected function drawLayout():void {

          textField.htmlText = this.label;

          super.drawLayout();

     }

}

}

Regards,

Rikun Patel

TOPICS
Development

Views

186

Likes

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
Sep 21, 2018 0

Have something to add?

Join the conversation