Thanks for the code; I'll look into the problem and file a bug. But it
doesn't surprise me that setting labelPath._x and labelPath._y like that
doesn't work... you're doing it before the layout inside the Button occurs.
I suggested setting them in an event handler, which would execute after the
layout occurs.

- Gordon


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 28, 2005 11:51 PM
To: [email protected]
Subject: [flexcoders] Re: Positioning from a label in a Button


buttonArray[i] = Button(hContainerButton.createChild( Button,
"button"+i, Button));
                        buttonArray[i].label            =
ar_documents[i].title;
                        
                        --------------NOT WORKING---------
                        buttonArray[i].labelPath._x = 0;
                        buttonArray[i].labelPath._y = 0;
                        ----------------------------------
                        
                        buttonArray[i].styleName        = ("readmore");
                        buttonArray[i].icon             =
ImageLibrary.gb_flag;
                        buttonArray[i].height           = 17;
                        buttonArray[i].labelPlacement = "left";
                        buttonArray[i].setStyle("borderThickness","1");



--- In [email protected], Gordon Smith <[EMAIL PROTECTED]> wrote:
> A Button has an undocumented property called labelPath whose value is a
> reference to the TextField that displays the Button's label. You
should be
> able to change labelPath._x and labelPath._y in an event handler for the
> Button's 'initialize' or 'creationComplete' event.
> 
> The Button code is supposed to automatically center the label inside the
> Button, taking into account the font size and the button height. Are you
> saying this isn't working for you? Can you send a snippet of code or
file a
> bug?
> 
> - Gordon
> 
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 28, 2005 8:12 AM
> To: [email protected]
> Subject: [flexcoders] Re: Positioning from a label in a Button
> 
> 
> --- In [email protected], "rockmoyosa" <[EMAIL PROTECTED]> 
> wrote:
> > Ok ok , I got de icon in my Button,but...
> > I resized the button to height = 17 and my label has a font-size of 
> 10.
> > but the effect is thathalf of my text is visble. So I want the 
> > following:
> > 
> > Or I can position my text with x and y
> > or an marginTop = X(something).
> > 
> > I find no standard solution in Flex?! Anybody!
> 
> Come it can't be that hard. Must I build my own Button just to place 
> my label a little bit higher in the button?
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links





 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to