10 Replies Latest reply on Aug 9, 2010 4:38 AM by smon_ed

    ComboBox measureText

    smon_ed Level 1

      Is there a way to measure the text of a spark ComboBox item label?

       

      I wish to measure the width of the ComboBox's items' label text and I can't find a way to do it.

       

      I tried this:

       

      measureText(comboBox.dataProvider[0]).width);

       

      but it comes up with an error:

      TypeError: Error #2007: Parameter antiAliasType must be non-null.

       

      Is there a way to simply measure the width of the text in the items?

       

      The only other way I can think of is to create a text component, copy the text into it and measure the width of it.  I don't want to have to do that if possible.