The problem you are going to face is that different fonts have different widths 
for different characters. For example, an "i" is thinner than an "o". You could 
try using a fixed width font and then counting characters.


--- In flexcoders@yahoogroups.com, "ivansebastiansurya" 
<ivansebastiansu...@...> wrote:
>
> Hi everyone,
> 
> I'm having a problem regarding measuring the width of a Label control.
> In my item renderer, I need to display a list of labels, but the number of 
> labels per row depends on how many of them fit within one row.
> To do that, I need to actually measure the width of the label created prior 
> to being added as a child of my renderer.
> Anyone has any idea how to do that?
> 
> I need something like:
> 
> var label:Label = new Label();
> label.text = "Test label";
> // Then I need to measure the width of the created label.
> 
> Cheers and thanks in advance for reading my post.
> 
> Ivan.
>


Reply via email to