How to Vertically center dynamic text?

I am trying to vertically center and wrap text within a Text div. I have figured out how to center text if it is a single line, but the text that I am using will be diffrent for each user depending on what language they view the page in. How can i make sure that text is always vertically centred and wrapped regardless of how long it is?

Could you do this with css? There is a css attribute display:table that allows you to set the paragraph attribute to align to themiddle of a region. See: http://css-tricks.com/vertically-center-multi-lined-text/
Hope that helps.

Similar Messages

  • How to vertically center InlineGraphicElements?

    Hi all,
    I'm trying to extend the InlineGraphic TLF example to insert images of varying sizes, but vertically center them in the text Flow.  I'm having trouble figuring out the correct parameters to properly center the element.  I've been playing with alignmentBaseline & dominantBaseline w/ IDEOGRAPHIC_CENTER, but I don't get very promising results.  Here's a screen shot of where I'm at:
    Notice the blue box(added in post), the text MESSUP is being placed on the same line as the Lorem Ipsum text(in the string, it's Donec MESSUP).  Also, the selection box (Ctrl+A) shows breaks in the text layout.  It seems like the boxes should be shifted up.  This may be as designed, if so, how do I compact/shift the boxes up?
    For contrast, this is what it looks like without the centering:
    Source:
    package
        import flash.display.Sprite;
        import flash.text.engine.TextBaseline;
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.edit.EditManager;
        import flashx.textLayout.elements.InlineGraphicElement;
        import flashx.textLayout.elements.InlineGraphicElementStatus;
        import flashx.textLayout.elements.ParagraphElement;
        import flashx.textLayout.elements.SpanElement;
        import flashx.textLayout.elements.TextFlow;
        import flashx.textLayout.events.StatusChangeEvent;
        import flashx.undo.UndoManager;
        [SWF(width="760", height="590", backgroundColor="0xCCCCCC", frameRate="30")]
        public class inliner extends Sprite
            protected var textFlow:TextFlow;
            public function inliner():void
                var elements:Array =
                    "Lorem ipsum dolor", null,
                    "sit amet, consectetur", null,
                    "adipiscing elit. Mauris eu odio nibh. Duis", null,
                    "scelerisque mattis risus, vitae viverra", null,
                    "ipsum vehicula non.", null,
                    "Donec MESSUP"];
                textFlow = new TextFlow();
                textFlow.fontSize = 34;
                textFlow.backgroundColor = 0xFFFFFF;
                textFlow.backgroundAlpha = 1;
                var imageSize:uint = 20;
                var paragraphElement:ParagraphElement = new ParagraphElement();
                textFlow.addChild(paragraphElement);
                for(var i:uint = 0; i < elements.length; ++i)
                    var obj:* = elements[i];
                    if(obj is String)
                        var string:String = obj as String;
                        var span:SpanElement = new SpanElement();
                        span.text = string;
                        paragraphElement.addChild(span);
                    else if(obj == null)
                        var inlineGraphic:InlineGraphicElement = new InlineGraphicElement();
                        inlineGraphic.width = imageSize;
                        inlineGraphic.height = imageSize;
                        imageSize += 20;
                        inlineGraphic.source = "http://www.adobe.com/shockwave/download/images/flashplayer_100x100.jpg";
                        // comment out to change back to good looking text
                        inlineGraphic.alignmentBaseline = TextBaseline.IDEOGRAPHIC_CENTER;
                        inlineGraphic.dominantBaseline = TextBaseline.IDEOGRAPHIC_CENTER;                   
                        paragraphElement.addChild(inlineGraphic);
                // event sent when graphic is done loading
                textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, graphicStatusChangeEvent);
                const bufferX:Number = 50;
                var sprite:Sprite = new Sprite;
                sprite.x += bufferX;
                addChild(sprite);
                textFlow.flowComposer.addController(new ContainerController(sprite, 760 - bufferX * 2, 590));
                // this call compose but the graphic hasn't been loaded from the source URL yet.
                // The actualWidth and actualHeight are zero. 
                refresh();
                var em:EditManager = new EditManager(new UndoManager);
                textFlow.interactionManager = em;
                textFlow.interactionManager.setFocus();
            protected function graphicStatusChangeEvent(e:StatusChangeEvent):void
                // if the graphic has loaded update the display
                // actualWidth and actualHeight are computed from the graphic's height
                if(e.status == InlineGraphicElementStatus.READY || e.status == InlineGraphicElementStatus.SIZE_PENDING)
                    refresh();
            protected function refresh():void
                textFlow.flowComposer.updateAllControllers();

    Cannot, really.
    Read this -
    http://www.apptools.com/examples/tableheight.php
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Reese" <[email protected]> wrote in message
    news:eh34gg$rvh$[email protected]..
    > How to vertically center a div? :-S
    >

  • How do I make dynamic text look static while the HMTL tagging is enabled?

    Hi all,
    I am using flash 8 with AS 2.0.
    I have a dynamic text field where I am setting it's text value through a variable. Now, I need this dynamic text field content to look like static font on runtime. I tried embedding the text field but that makes my file so heavy and most importantly, it disables the HTML tagging on the text field.
    Please suggest me on how to make a dynamic text field content look static on runtime while the HTML tagging is enabled and working fine.
    Thanks.

    I am sorry. But the attachment was not intended for what you
    thought my friend.
    It was there so that there are no confusions for what I mean by look of dynamic and static text fields.

  • How to make a dynamic text  be SMS by fl2.1

    Now ,I know use " getURL("sms:"+telnumber) "to send sms to a
    specified no.,but how to make a dynamic text be the sms content.?
    Many thx!:

    Ciao,
    this should work:
    smstxt = "ciao, happy holidays";
    telnum = "1234567890";
    getURL("sms:"+telnum+"?body="+smstext);
    body is a keyword.
    Alessandro

  • How to vertical select a text in iWord.  Like we do in Mac version of MS Word by Command Option [and selecting]

    How to vertical select a text in iWord.  Like we do in Mac version of MS Word by Command Option [and selecting]

    m0thr4 wrote:
    I want to make sure all text in my document is a particular font (at least), but Cmd+a only selects any text that is not in a table. There seems to be no way to include text in tables, or even a way to change the format of all text in a particular table (MS Word allows the whole table to be highlighted for example).
    A double click in a cell selects it so you may enter what you wish in it.
    Select the cell A1 then, pressing the shift key, click in the right-bottom cell.
    Doing that you will get every table's cells selected which gives the ability to apply global attributes.
    I've searched the built-in help and found "To select all text in a document, choose Edit > Select All." This does not work as tables are excluded from this selection. If tried some of the other suggestions, such as holding down shift while selecting text in tables, but as soon as I get to the end of the text in one cell, the selection disappears.
    My guess is that some words are missing in the Help. Select All selects all the text … of the text layer.
    We must apply the settings to the text layer, to each text box, to each table.
    Of course, you may _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09
    Yvan KOENIG (from FRANCE vendredi 10 octobre 2008 17:16:06)

  • - How to vertically center a div?

    How to vertically center a div? :-S

    Cannot, really.
    Read this -
    http://www.apptools.com/examples/tableheight.php
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Reese" <[email protected]> wrote in message
    news:eh34gg$rvh$[email protected]..
    > How to vertically center a div? :-S
    >

  • How do i center the text of a JLabel?

    How do i center the text of a JLabel?

    http://java.sun.com/j2se/1.4/docs/api/javax/swing/JLabel.html#setHorizontalTextPosition(int)

  • How to vertically center text within its container

    Whether in a button, or a text element, I see no way to center the text that you type *vertically* in the container.  I'm not talking about within the box element.  I mean just the text element itself.  If I size out a text area and start typing in it, I should be able to say center it vertically.  That's what I'm looking for anyway.   Help much appreciated.

    Text elements cannot be vertically centered as they are not containers. However, you can fake that somewhat by making the line-height very large. But this means if you have text spanning two lines it would be very far apart though

  • HT3384 How do you set the text layout in Pages on the vertical? How do you center the text?

    How do you align the text vertcially?

    Stru,
    You posted your question in the Pages (word processor) discussion area. Hope you can find your way back to Excel without any difficulty. The answer wouldn't have been much different had you posted in the Numbers discussion.
    Jerry

  • Vertically Centering Dynamic Text

    I am trying to get the text I am loading into a dynamic text
    box vertically aligned. There are from 3 to 8 lines of text that
    load into the dynamic text box via an array. I haven't found
    anything to do this. Can I get a coordinate that tells me the
    height of the loaded in text? Thanks for any help...

    I have the answer to my own question....
    placeText = function(){
    //this first line just creates a variable with the button
    number pushed
    var currentButton = _parent._parent.buttNo;
    //oBox_txt is my dynamic text box
    oBox_txt.autoSize = "center";
    //this line populates the text box with text from an array
    using the predefined
    //variable "currentButton"
    oBox_txt.text = textual[currentButton];
    oBox_txt._y = ((100 - oBox_txt._height) / 2);
    This assumes that the box is at the _y coordinate 0, and that
    the box is 100 pixels high.

  • How to use same dynamic text, multiple times in a Movie

    FLASH CS5.5
    How can a dynamic text field be used multiple times, on any
    frame, in any new layer during a Movie?
    ~~
    A number of unique dynamic text fields are being used.
    The intent is to use them each, many times during a Movie.
    (i.e. a users first name)
    They are successfully being "ExternalInterfaced" from a PDF form field.
    (the SWF is displayed within the PDF as a RMA)
    This all works well, IF I only use one instance of the dynamic text field.
    (one use of each unique text field)
    If I try and use that same dynamic text field, again, in a new layer, later in the SWF,
    all of that said, duplicate dynamic text fields do not display.
    ~~
    Stumped!!!
    Thanks in advance for your advice / comments!
    D-

    Thanks Ned,
    I always welcome learning something new.
    I did not know creating a new keyframe,
    creates a new instance.
    Yes, I had used the same dynamic text field instance name in
    numerous, new layers (great observation).
    With the objective to display the User's name throughout
    the timeline (on and off)...
    I'll attempt to paraphrase your solution;
    Use a single layer to display the dynamic text field.
    Extend this layer's timeline throughout the movie, or end use of the dynamic text field.
    Help with this one ??
    Set the visible properties to true or false as need through out the timeline.
    ( Does require an AS3 ? )
    I'll give that a try.....
    ~~
    Side of effect of using the above solution;
    The SWF in it's attempted state, uses the dynamic text field instance, in
    different places, different text sizes, on the stage, throughout the Movie.
    (i.e. the User's first name appears in different sentences...)
    Per the solution above,
    I believe I will be limited to One location, one format setting.
    Is this assumption correct?
    I can make this work from a display / Movie point of view.
    However, your first VAR concept, noted above, might be
    worth exploring should more flexibility be required.
    Thanks for making the time to coach...
    D-

  • How do I center a text field when input can be single or multi-line?

    I'm creating a form in Adobe Acrobat Pro XI and have almost everything the way I want it.  One of my last problems is trying to get a text in a text field centered.  The input is sometimes a single line and sometimes multi-line.  If I set it up so the multi-line entries are centered, then the single line looks off ... and vice versa.  Is there any way to have the text automatically centered in the text field regardless of whether it's single or multi-line?

    Unfortunately, there's no way to set up a field so that the text is guaranteed to be vertically centered in both cases. If you set it up so that rich text formatting is enabled, it's possible for a user to vertically center, but it's not something you can preconfigure so that it will remain in effect when the field is cleared. For a user to do this, with the focus set to the field they'd have to display the Properties toolbar (Ctrl+E), click the "More..." > Paragraph > Alignment > Text Middle [button]

  • How to display the dynamic text in the selection screen

    Hi All,
    I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
    EX: If i have the date of today 31st  it has to show message like " today date is 31 like some thing "  when i execute the report .
    Could any one face this sort of requirment, Please let me know.
    Thanks in advance.
    Reagrds,
    Bharani

    Where would you like this dynamic text being displayed? As an "message" or in some parameter field?
    If first
    parameters date type d.
    data: text type string.
    at selection-screen.
       concatenate 'Today is' date into text.
       message text type 'I'.
    If second
    parameters pa_text type c length 50.
    at selection-screen on date.
      if date is not initial.
        concatenate 'Today is' date into  pa_text.
      enidf.
    at selection-screen output.
       "show it as read only
       loop at screen.
        if screen-name = 'PA_TEXT'.
               screen-input = abap_false.
              modify screen.
        endif.
       endloop.
    Regards
    Marcin

  • How to use an dynamic text from Flash in FlashBuilder with swf ?

    Hello,
    i'm trying to develop a game in flex builder and i got a problem with the dymanic text i've imported from flash. I want to insert a scoreboard in my application and for doing that i should use dynamic text in flash. I create a dynamic text in flash and then a import it to Flash Builder in a movie clip, and i called the dynamic text "Score". Now i've tried to use the "Score" variable to change the value of the dynamic text box un my flash builder application, but it doesn't change anything.
    I read somewhere that i've got to use the score.text value to change the number of my score but that doesn't works because Flash Builder tells me that this sort of variable don't contain the .text value.
    Thank you for trying to help me.
    bye.

    Thanks Ned,
    I always welcome learning something new.
    I did not know creating a new keyframe,
    creates a new instance.
    Yes, I had used the same dynamic text field instance name in
    numerous, new layers (great observation).
    With the objective to display the User's name throughout
    the timeline (on and off)...
    I'll attempt to paraphrase your solution;
    Use a single layer to display the dynamic text field.
    Extend this layer's timeline throughout the movie, or end use of the dynamic text field.
    Help with this one ??
    Set the visible properties to true or false as need through out the timeline.
    ( Does require an AS3 ? )
    I'll give that a try.....
    ~~
    Side of effect of using the above solution;
    The SWF in it's attempted state, uses the dynamic text field instance, in
    different places, different text sizes, on the stage, throughout the Movie.
    (i.e. the User's first name appears in different sentences...)
    Per the solution above,
    I believe I will be limited to One location, one format setting.
    Is this assumption correct?
    I can make this work from a display / Movie point of view.
    However, your first VAR concept, noted above, might be
    worth exploring should more flexibility be required.
    Thanks for making the time to coach...
    D-

  • How do I center the text in full width accordion panel?

    Hello!
    Is it possible to center the text to follow the full width accordion widget?
    When you expand to fill the screen, the text are fixed and doesn't follow the center headline...
    I created a page so you see what I'm talking about:  http://fullwidthissue.businesscatalyst.com/index.html
    Please respond if you know what to do or if it's impossible..
    Thanx

    This believe this can be fixed within the <head> of the document. I had the same problem and it took me a bit to figure this solution.
    Step 1
    Find the <div> ID that muse gives to the content portion of the accordion element. you can find this by using a web browser that lets you inspect the code.
    Step 2 once you have that code replace u6174. with your specific <div> then past this into your <Head> of the muse document. Almost forgot.....Get a general idea of the minimum size around your content this example it was a width of 750px. and change the width accordingly on this code.
    <style>
    #u6174{
    width: 750px;
    padding-left: 0px;
    padding-right: 0px;
    margin-right: auto;
    margin-left: auto;
    border-right-width: 0px;
    border-left-width: 0px; "}
    </style>
    you can see a sample of this here:
    Alain Hunkins
    At the bottom is this solution working.
    Let me know if that helps.

Maybe you are looking for

  • WEBUTIL_C_API.REBIND_PARAMETER will not work

    hi, getting an error oracle.forms.webutil.cApiFunctions bean not found WEBUTIL_C_APIREBIND_PARAMETER WILL NOT WORK please can anyone fix this error thanks in advance pa1

  • Using multiple instance variables or BPM objects in a single JSP

    In my screenflow, for an user activity, I've selected a BPM object variable for my JSP and using this BPM object variable within the JSP to display or accept values related to this BPM object. But in certain circumstances, I need access to some of th

  • How to block my nokia mobile imei?

    plz block my nokia imei-35XXXXXXXXXXXXX Moderator's Note: This post was edited and the IMEI was removed. Please do not publish unique serial number on a public forum. Solved! Go to Solution.

  • MR11- Change account determination

    All- How do we change the account determination that are  set up for MR11 (GR/IR clearing). We want it to post to a manfucatoring account instead of an inventory account when doing this transcation. Transcations/ steps would be great if you know... T

  • How to parse flat file

    What I have is a tab delineated file. Example - ACP     047     047     047     09072011     600058          MIX35     T6          097     429097068158900300     PLUS     12312011     TEST      JAMIE     1397090     0000000     000     001     000000