You could grab the actual width of the label or you could put the label in a 
container like an HBox and set the horizontalAlign="right" on the HBox. Set the 
width of the HBox to 100 if that is the max. Then set the x property or right 
style on the HBox as stated below.
 
Karl
Cynergy

________________________________

From: [email protected] on behalf of Nate Pearson
Sent: Wed 2/28/2007 1:44 PM
To: [email protected]
Subject: [flexcoders] Re: Right Aligned Text in a UIComponent



Yes I mean aligned right. The x to equal parent.width - 100 doesn't
work because the text is dynamic. Some times it will have a width of
10 and some times it will be 90. I just set it to 100 because I know
it will never go over 100.

Maybe there is a parameter that will make the label width "flex" with
the amount of text in it? Then i could do x = parent.width -
label.width. I couldn't find this parameter though.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Karl 
Johnson" <[EMAIL PROTECTED]>
wrote:
>
> What do you mean by making the x location the right side? If this is
a canvas, then just set "right equal to "0" if you just want the text
box to be as far to the right as possible in the container.
> 
> You could also set the x to equal parent.width - 100. Does that
solve what you are asking?
> 
> Karl
> Cynergy
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>  on 
> behalf of Nate Pearson
> Sent: Wed 2/28/2007 11:13 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Right Aligned Text in a UIComponent
> 
> 
> 
> Anyone have any ideas?
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com> 
<mailto:flexcoders%40yahoogroups.com> , "Nate Pearson" <napearson99@>
wrote:
> >
> > I'm adding a label to a UIComponent at a dynamic x location. The text
> > for that label is also dynamic.
> > 
> > How can I make it so the x location is the right side of the label? 
> > Here is my code:
> > 
> > var endDate:Label = new Label();
> > endDate.graphics.lineStyle(1,0x000000);
> > endDate.text = data.EDText;
> > endDate.styleName = "columnEnd";
> > endDate.height=20;
> > endDate.width = 100;
> > endDate.x = ratio*data.ED;
> > endDate.y = 30;
> > myUIComp.addChild(endDate);
> > 
> > -Nate
> >
>



 

Reply via email to