Aligning a button's label

Hi,
I'm struggling around with getting a button's label aligned
to the left or right side. What I did was dropping a button
component to the stage, removed it and added the following script
on the timeline:
import fl.controls.Button;
var myButton:Button = new Button();
myButton.label = "Hello World!";
myButton.setSize( 300, 50 );
myButton.setStyle( "textAlign", "left" );
addChild( myButton );
Whatever I tried, the label is always centered (also with
TextFormat, TextFormatAlign etc, etc.)
I'm just using Flash CS3 IDE, so no Flex. I saw it working
somewhere on the net scripted with MXML.
So my question is: Is this doable without the use of Flex and
are there some limitations regarding Flash CS3 components?

Check out this example page for Tutorials:
http://www.adobe.com/devnet/flash/quickstart/button_component_as3/#section7
You might have to fake it if you wish to use the Pre-Built
Button Component by putting in space characters as in " Hello
World!" or a transparent element to offset the text like a graphic
or alpha 0 shape. The component is set to scale-9 and auto-center.
- Also might try to alter the autoSize = TextFieldAutoSize.CENTER
to LEFT to see if resets the starting x position of the component's
text-field.

Similar Messages

  • Multi-line toggle button bar labels?

    I am trying to do a grid of buttons where only one button in a row can be "pressed".  Seems, based on suggestions here as well, the easiest way is one togglebuttonbar per row of a grid.
    Anyway, I need to have taller buttons with a few lines of text in each label (button).  Think of a table where the cells are selectable.
    I found a way to extend a simple button's label to make it multi-line, but not sure on how to do this for a togglebuttonbar:
    package tools
    import flash.text.TextFieldAutoSize;
    import mx.controls.Button;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class MultilineButton extends Button {
    public function MultilineButton()
    {super();}
    override protected function createChildren():void
    super.createChildren();
    textField.multiline = true;
    textField.wordWrap = true;
    textField.autoSize = TextFieldAutoSize.LEFT;
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    textField.y = (this.height-textField.height)>>1;
    And then I call it with <t:MultilineButton label="four score and seven years ago" width="150" height="150" textAlign="left"/>
    Should I just use this single button in a Repeater?  Or is there a way to work with the togglebuttonbar?

    I tried that, I guess I am doing it wrong since it is still doing centered
    and bold:
    package tools
    import flash.text.*;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class MultilineToggleButtonBar extends ToggleButtonBar
    public function MultilineToggleButtonBar()
    super();
    override protected function createChildren():void
    super.createChildren();
    textField.multiline = true;
    textField.wordWrap = true;
    textField.autoSize = TextFieldAutoSize.LEFT;
    var format:TextFormat = new TextFormat();
    format.bold = false;
    format.align = "left";
    textField.defaultTextFormat = format;
    override protected function updateDisplayList(unscaledWidth:Number,
    unscaledHeight:Number):void {
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    textField.y = (this.height-textField.height)>>1;

  • Graph Data does not align with the axis label

    Hi,
    The graph data does not align with the axis label when
    datetimeaxis is used.
    http://livedocs.adobe.com/labs/flex3/html/help.html?content=charts_displayingdata_04.html
    (in the using parseFunction property example) when you hover on the
    line graph the values do not align on the labels. Is this a bug?
    Can somebody help me with this.
    Thank you,
    Gautam.

    Hi All
    Thanks for looking into it.
    Actually we have just added a field GJAHR (was missing in the extractor) so that it takes data accoring to fiscal yr. Actually we had a issue that the Business area for a particular vendor 'X' and doc no 'Y' was showing incorrectly (similar to that of yr 2008) but it changed this yr and the extractor was still picking Business Area for yr 2008.
    So we added GJAHR field so that it takes correct Business Area. we have checked in R/3 Extractor checker and it shows correctly.
    But that change has not reflected in BW yet even after replicating datasource.
    I hope i have made you all understand the situation.
    Thanks for your help
    Ishi

  • No Align track button in Mocha AE CS6

    There is no align surface button for me in Mocha ae CS6 version 2.6.2. I follow all the other tracking steps and when I paste the tracking info to the correct layer it always get skewed and looks really weird. I can only assume its from not aligning the surface. Please help ASAP! I am running Os X Mavricks.

    You already got an answer here:
    http://forums.creativecow.net/thread/2/1043597#1043634

  • Moving object (like button, textfield ,label,.....)

    if I have an object in the applet area like (button , textfield, label,....) and if I want to move the object buy simply click on the object and drag it to move it.
    if someone a solution send to me on :
    "[email protected]"

    if I have an object in the applet area like (button ,
    textfield, label,....) and if I want to move the
    object buy simply click on the object and drag it to
    move it.
    if someone have a solution send it to me on :
    "[email protected]"

  • Align region button to middle

    Hi,
    How to modify the alignment of report region button(say for Tabular report form)
    to middle rather than the default left and right one .
    Any idea or i have to change the template manually ? Then what area of the template to be changed ?
    Regards,
    Rosy

    Hi Vikas,
    How can you say that it is not controlled by the template while the Button template have the code like and the button is template based button :
    <table cellpadding="0" cellspacing="0" border="0" class="t12ButtonAlternative3" summary="">
    <tr>
    <td class="t12ButtonAlternative3Left" width="3">
    </td>
    <td style="padding-left: 10px; padding-right: 10px;">#LABEL#</td>
    <td class="t12ButtonAlternative3Right" width="3">
    </td>
    </tr>
    </table>
    So there must by some way of tweaking the code or the adding some code in the referred stylesheet to solve the problem ........?
    what do u think ?
    ROSY

  • Help setting up back navigation button by label name.

    Newbie back for some gems of wisdom.
    I am trying to get forward and back buttons to advance the user along the timeline by label name. I got the forward button to work, but can't seem to find the right code tweakage to get the back button to work.
    Here is what I have:
    stop();
    var myLabels:Array = [ "A","B","C","D","E","F","G","H" ];
    var nextLabel:String;
    var inc:int = 1;
    var prevLabel:String;
    var inc2:int = -1;
    fwdbtn.addEventListener(MouseEvent.CLICK, clickNextSection);
    function clickNextSection(e:MouseEvent):void
        nextLabel = String(myLabels[inc]);
        gotoAndPlay(nextLabel);
        inc++;
    bkbtn.addEventListener(MouseEvent.CLICK, clickPreviousSection);
    function clickPreviousSection(e:MouseEvent):void
        prevLabel = String(myLabels[inc2]);
        gotoAndPlay(prevLabel);
        inc2++;
    I'm sure there are some reduncies and I know I'm missing the variable that tells the timeline to subtract positioning from the array.
    Do I need to define a new array for the back button?
    Any idea what I'm messing up??
    Thanks!!

    Thanks for the reply! Kind of lost unfortunately.
    So can you tell me how to edit the code to reflect that? Not sure how what the deincriment syntax and is and not sure how to set it up the way you are suggesting - only adding deincriment/increment on the fly.
    Any help you could lend to chopping the code would be appreciated.
    Love the logic you suggest. That would ideal for it to work from any point.
    Thanks for your help!

  • Alignment in Smart Forms- Label

    Hi Folks,
    I have data in an internal table. I have to print a label. In the print preview I am able to see the data like this.
    PLANT               : 0120          BATCH             9
    MATERIAL       : 100628
    MATERIAL DESC: Part 1 LIQUIDE
    RELEASE/LOT : 04000000000971     DATE      12/20/2002.
    QUANTITY          :                   1
    But I need the alignment like this for any data
    <b>
    PLANT                 : 0120                     BATCH             9
    MATERIAL           : 100628
    MATERIAL DESC : Part 1 LIQUIDE
    RELEASE/LOT     : 04000000000971    DATE      12/20/2002.
    QUANTITY           : 1</b>
    For the quantity field I need to condense that and can anyone explain me in detail
    hw to do this.
    I need to print for many records. Some fields may have data. some time space. .
    In my smartform I have aligned it properly.
    Thanks for your time. waiting for your replies.
    with regards,
    chaithanya.

    Hi..
    Amit thanks for u r reply. In Template can we design like this
    Material..........xxxxxxxxxxx.................Batch.............XXXXXXXXX
    If u have any tutorial Please let me knw...
    I have solved this problem...using the tabs....
    with regards,
    chaithanya.

  • Can you link buttons to labels in a separate movieclip?

    I'm fairly new to flash so please excuse my lack of knowledge...using AS3
    basically I had a situation arranged where when a button was clicked and flash would then display a certain image by jumping to a label on the timeline, and by clicking a different button a different image would be shown. this was working pretty well but for layout reasons I had to split these buttons and the timeline that they relate to up into separate movie clips.
    obviously the buttons dont do anything now,
    but what i'm hoping to find out is how I can link these items back up despite them being in separate movie clips.  is this possible?
    i'm just wanting them to do the same thing they did when they were both in the same movieclip.
    any help is extremely welcome
    thank you

    thanks for replying
    at the moment I have  the following...  with "baird" being both the instance name and the label name
    baird.addEventListener(MouseEvent.CLICK, clickbaird);
    function clickbaird(evtObj:MouseEvent) {
    MovieClip(parent).maincontent.bigchap.kiltclip.gotoAndStop("baird");
    its not returning any error messages but its still not doing what i want it to :/
    the whole thing is contained within a mc with an instance name maincontent...   then another movie clip with a instance name bigchap contains more movieclips, the one i'm working with just now with all the labels on a timeline is called kiltclip.
    Then theres the buttons which are located within a movieclip with an instance name of kiltpanel, which is inside a movie with an instance name controlpanel. which is inside maincontent.
    i'm trying to build an 'outfit builder' type thing for a highlandwear company I work for

  • Button with label Unicode

    Hi everybody!
    I want to creat an applet, and there's one button in it. I want to set its label with some Unicode chars. For example, I want to use Chinese chars as the label for this button. Does anybody can explain me how I can do it?
    Thanks in advanced.

    You should be able to just set the lable to whatever chinese character you want to use. Just create a string that holds those characters, and call Button's setLabel method.

  • How to align printer for cd labels

    How do I align printer for CD lables?

    Hi,
    Just try-on-error. From the good old days, my successful rate was around 30% that why I bought a new printer which can print on printable CD/DVD's directly. By the way, you have to be very careful with the paper labels, they may stuck inside your player after a while, specially if hot.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Bug in flex 4, with truncating the link button and labels

    hey guys.. so my application has a popupanchor, and in that popup anchor i have multiple linkbuttons... and for some reason no matter what i try, it truncates all the link buttons, as well as the labels on accordions.
    i know that the button is not in a group with small width... ive also tried wrapping the link button in a group with a width of 500, and still the link button gets truncated...
    any ideas on how to fix this problem??
    if you would like the following is the code i have... essentially all the labels and linkbuttons gets truncated after the second time i popup the popupanchor.
    <s:PopUpAnchor id="detailsPopup" popUpPosition="topLeft" styleName="popUpBox" depth="20">
         <s:VGroup id="detailsGroup" contentBackgroundColor="#ffffff" height="518" width="791">
              <s:Group width="100%" height="100%">
                   <s:Rect width="100%" height="100%">
                        <s:fill>
                             <s:SolidColor color="#ffffff"/>
                        </s:fill>
                   </s:Rect>
                   <s:VGroup>
                        <s:BorderContainer backgroundColor="#0184C7" width="100%" height="88" borderVisible="false">
                             <mx:LinkButton label="[ X ]" skin="{null}" x="750" y="5" fontSize="8" color="#ffffff" rollOverColor="#333333" click="hideDetails.play(); resetVars();" />
                             <storyTextbox:advancedTextInput id="title" defaultText="Insert Title Here" fontSize="18" color="#ffffff" focusColor="#ffffff" width="575"
                                                                     height="30" verticalCenter="0" left="12" contentBackgroundColor="#0184C7" borderVisible="false"/>
                             <storyTextbox:advancedTextInput id="subHeading" defaultText="Insert Subtitle Here" fontSize="10" height="20" y="63" left="12" focusColor="#ffffff" width="315"
                                                                     color="#ffffff" contentBackgroundColor="#0184C7" borderVisible="false"/>
                             <s:VGroup paddingLeft="600" paddingTop="25">
                                  <s:HGroup>
                                       <s:Label text="File Name: " color="#ffffff" fontFamily="DINOT-Bold" />
                                       <s:Label text="{currentSelection.FileName}" color="#ffffff" fontFamily="DINOT-Regular" maxWidth="111" lineBreak="explicit" />
                                  </s:HGroup>
                                  <s:HGroup>
                                       <s:Label text="Video Id: " fontFamily="DINOT-Bold" color="#ffffff" />
                                       <s:Label text="{currentSelection.VideoId}" fontFamily="DINOT-Regular" color="#ffffff" />
                                  </s:HGroup>
                             </s:VGroup>
                             <s:HGroup paddingLeft="400" paddingTop="60">
                                  <s:Label id="dateFieldLbl" color="#ffffff" text="Date Available" paddingTop="5" paddingRight="15" />
                                  <s:Group>
                                       <mx:DateField id="dateField" initialize="txtFieldInitialized();" x="-75"
                                                        change="getSelDate();" styleName="dateFieldStyle" depth="100" fontSize="10" />
                                  </s:Group>
                             </s:HGroup>
                             <s:HGroup paddingTop="65" paddingLeft="515">
                                  <s:CheckBox id="corp" label="Corporate" styleName="checkboxStyle" selected="false" />
                                  <s:CheckBox id="insider" label="Insider" styleName="checkboxStyle" click="checkBoxClicked(insider);" selected="false" />
                                  <s:CheckBox id="podcast" label="Podcast" styleName="checkboxStyle" click="checkBoxClicked(podcast);" selected="false" />
                                  <s:CheckBox id="iphone" label="iPhone" styleName="checkboxStyle" click="checkBoxClicked(iphone);" selected="false" />
                             </s:HGroup>
                        </s:BorderContainer>
                        <s:HGroup>
                             <s:BorderContainer borderVisible="false">
                                  <s:VideoPlayer id="videoPlayer" width="545" height="307" mediaPlayerStateChange="vidPlyr_mediaPlayerStateChangeHandler(event);"
                                                    visible="true" skinClass="modules.videoHandler.components.videoPlayerSkin" dropShadowVisible="false" />
                                  <mx:LinkButton label="CAPTURE" skin="{null}" color="#0184C7" rollOverColor="#333333" click="captureVideo();" top="330" left="475" />
                             </s:BorderContainer>
                             <s:VGroup>
                                  <s:HGroup>
                                       <mx:Image id="initialThumbnail" styleName="imgSkin" source="{popupThumbnail}" width="100" height="55" />
                                       <s:Group>
                                            <mx:LinkButton label="SAVE" skin="{null}" color="#0184C7" rollOverColor="#333333" paddingLeft="78" paddingTop="16" click="saveData();" />
                                            <mx:LinkButton label="CLOSE" skin="{null}" color="#0184C7" rollOverColor="#333333" paddingLeft="68" paddingTop="30" click="hideDetails.play(); resetVars();" />
                                       </s:Group>
                                  </s:HGroup>
                                  <mx:Accordion id="tagsNCategoriesAccordion" width="225" height="285" borderVisible="false" headerStyleName="headerStyle" borderStyle="none">
                                       <s:NavigatorContent id="channel" label="Channel" visible="false">
                                                            </s:NavigatorContent>
                                  </mx:Accordion>
                             </s:VGroup>
                        </s:HGroup>
                   </s:VGroup>
              </s:Group>
         </s:VGroup>
    </s:PopUpAnchor>

    ive tried it on simpler cases... it seems to happen when ever the buttons are on a popupanchor...
    so when i popup the anchor for theffirst time it works, but when i pop it up again thats when i start noticing the truncation.... if that makes any sence

  • How to right align the buttons in JOptionPane?

    Hi,
    I am using JOptionPane in my code.
    I want all the default buttons that are created by any of the JOptionPane methods (e.g. JOptionPane.showMessageDialog()) be right aligned. Currently all the buttons are shown center aligned.
    Here is the only code that I have to display the dialog:
    JOptionPane.showMessageDialog(getInstance(), msg, "Deprecated components", JOptionPane.WARNING_MESSAGE);
    Can someone tell me how to achieve this?
    Regards,
    ParagJ

    Build your own JDialog

  • Vertical align for buttons

    Hi,
    I have many buttons beside "regular fields". I can't align the vertical position. The bottom of the buttoms aren't aligned with the text fields. I tried to modify the CSS template without success. Is there a way to align all bottoms in a report row ?
    Thank you

    Have you tried to go into the properties of the report and then the properties of the column and set the Element Attributes and Element Options Attributes? Here you could set valign=center.

  • Problem with radio button and labels

    Hi Team,
    I have defined the LOV for a form field as STATIC:yes;y,no;n and in 2 columns.
    This is what I get at runtime
    <table>
    <tr><td nowrap="nowrap"><input type="radio" name="p_v07" value="n" id="P18_USED_PRODUCTS_0" />
    <label for="P18_USED_PRODUCTS_0">no</label></td>
    <td nowrap="nowrap"><input type="radio" name="p_v07" value="y" id="P18_USED_PRODUCTS_1" />
    <label for="P18_USED_PRODUCTS_1">yes</label></td>
    </tr>
    </table>
    I want Yes to be the first button. How can I do that? I can with a LOV, but "static" is easier for trivial things like y/n etc.

    Raymond,
    You can use the keyword STATIC2 instead of STATIC to render the options in the order you code them.
    - Scott

Maybe you are looking for

  • ODI not able to detect primary/foreign keys from XML- user lacks privilege or object not found

    Hi Guys, Im trying to load an xml file with two entities address and employee as below. The topology reverse engineering everything works fine. Im even able to view the xml data  in ODI,  but when i try to load the data from these two entities joinin

  • EJB 3.0 specification is finalized??

    Hi, We have a new J2EE proyect, we planning make it with EJB 3.0,but i dont know, this specification is finalized?? we are looking for application servers, we work with WebLogic, but yet no have full support to EJB 3.0. I dont nkow that use j2ee ejb

  • Precedence and Associativity code snippet

    Look at this code snippet and assume the value of i is 2: ((k = (++i)) + (j = (2 * (++i))))We have the pre-increment operator showing up twice and that operator is the highest level precedence in this example. Next in line as far as precedence goes i

  • Maintaining page stack using BC4J framework

    We are developing a web application using JDeveloper(using bc4j+struts) in which list of functions are available in the tree menu on the left side. On clicking any function three tabs are displayed in the main body which are search, result list and m

  • MDM-Catlog 2.0

    Experts, i need to do requirement gathering for SRM MDM catalog implemenation.Plz let me know, what are the points , i need to look out for. If some can provide me some details , it would be very helpful for me. Thanks in advace. Rgrds, SK