Vertically align middle input text in a text box

I'm creating Flash-based software that has text boxes where users write in the answers to questions. I want the text that the user types to be vertically aligned to the middle of the text box, so that even if the response is two or three lines, it is still centered in the box.
It doesn't appear that I can accomplish this through the properties window in Flash. Am I missing something? Or is it possible to set the properties of the text box with actionscript, and would that allow me to vertically align the text?
Thanks!

You're not the first to ask this, but if you got an answer of how to do it, you'd likely be the first.  I don't think it is possible since there doesn't appear to be any sort of top margin property available for TextFields.  You might be able to fake something like that though if you think about it... like using the changed event of a textfield to reposition it vertically in a pseudo border/bkgnd.
If you do come up with a solution, you should share it here... as I said, you're not the first to ask.

Similar Messages

  • Vertical align to center in a div

    Hi,
    I'm putting together a css layout in dreamweaver CS3, i have a basic nav bar with a solid black colour with text on top. I'm trying to vertical align the text to the center, currently it's center horizontally, but the text is right at the top of the div. The only way i've been able to change the position is to use "line height"
    Any there any easy way to do this in css?
    Any help is much appreciated, thanks.

    Hi again,
    I'm having a bit of trouble trying to get my main text area vertically center on one of my pages, i have a two column layout(text area on the right). The above methods don't seem to work, they just seem expand my whole bodyArea downwards.
    Currently my codes look like this:
    Layout:
    <style type="text/css">
    <!--
    body {
         background-color: #666666;
    #wrapper #bodyArea #left {
         background-image: url(images/picture.jpg);
         float: left;
         background-repeat: no-repeat
    -->
    </style></head>
    <body>
    <div id="wrapper">
      <div id="logo"></div>
      <div id="nav"><a href= nav text here </a></div>
      <div id="bodyArea">
        <div id="left"></div>
        <div id="shadow"></div>
        <div id="right">text with paragraphs here</div>
        <div id="footer">copyright info here</div>
      </div>
    </div>
    </body>
    </html>
    stylesheet:
    #wrapper {
         width: 781px;
         margin-right: auto;
         margin-left: auto;
            height: 699px;
    #wrapper #logo {
         height: 116px;
            background-image: url(../images/logo.jpg);
    #wrapper #nav {
         height: 38px;
         text-align: center;
         color: #FFFFFF;
         font-family: "Courier New", Courier, monospace;
         font-size: 19px;
         line-height: 38px;
         background-repeat: no-repeat;
         background-color: #000000;
         margin: 0px;
    #wrapper #bodyArea #left {
         width: 341px;
         float: left;
         height: 507px;
    #wrapper #bodyArea #right {
         width: 440px;
         float: right;
         height: 507px;
         text-align: center;
         color: #000000;
         vertical-align: middle;
         font-family: Arial, Helvetica, sans-serif;
         font-size: 16px;
    #wrapper #bodyArea #right #shadow {
         height: 14px;
         background-image: url(../images/shadow.gif);
         background-repeat: repeat-x;
    #wrapper #bodyArea #footer {
         height: 38px;
         clear: both;
         text-align: center;
         color: #FFFFFF;
         background-color: #000000;
         font-family: Arial, Helvetica, sans-serif;
         font-size: 15px;
         line-height: 38px;
         margin: 0px;
    p {
         margin-top: 0px;
         margin-right: 10px;
         margin-bottom: 15px;
         margin-left: 10px;
    I'm fairly new to CSS layouts, if anyone could help me it would be much appreciated, thanks.

  • Vertical alignment off in table columns

    I have a table with 3 columns with one row above and below
    Text in left and right column is aligned to the top but in
    the middle column the text will not align to the top. In IE it is
    correct but in Firefox 1.6 it is down by 1 line
    How to correct?
    David
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN" "
    http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML
    xmlns="
    http://www.w3.org/1999/xhtml"><HEAD><TITLE>BustedComputer</TITLE>
    <META http-equiv=Content-Type content="text/html;
    charset=iso-8859-1" />
    <style type="text/css">
    <!--
    body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11pt;
    color: #000000;
    margin-left: 0px;
    margin-top: 0px;
    table, td
    border-color: #000000;
    border-style: solid;
    table
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
    td
    margin: 0;
    padding: 10px;
    border-width: 1px 1px 0 0;
    vertical-align: top;
    a:link { color: blue; text-decoration: none }
    a:active { color: blue; text-decoration: none }
    a:visited { color: #0000FF; text-decoration: none }
    a:hover { color: blue; background-color:#FFFF9D;
    text-decoration: underline }
    -->
    </style>
    </HEAD>
    <BODY>
    <TABLE cellSpacing=0 cellPadding=0 width=800 align=center
    border=0>
    <TBODY>
    <TR>
    <TD colSpan=3 bgcolor="#6699FF">Top</TD>
    </TR>
    <TR>
    <TD width="150" bgcolor="#6699FF"><a
    href="#">leftside</a></TD>
    <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief, Lorem Ipsum is not simply
    random text. It has roots in a piece of classical Latin
    literature from
    45 BC, making it over 2000 years old.<br>
    <br>
    Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de
    Finibus
    Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written
    in 45 BC. This book is a treatise on the theory of ethics,
    very popular
    during the Renaissance. The first line of Lorem Ipsum,
    "Lorem ipsum dolor
    sit amet..", comes from a line in section 1.10.32.</p>
    </TD>
    <TD width="150" bgcolor="#FFFFCC">rightside</TD>
    </TR>
    <TR>
    <TD colSpan=3 bgcolor="#6699FF">Bottom</TD>
    </TR></TBODY></TABLE></BODY></HTML>

    Could it be that you are seeing the top margin on the
    <p> tag?
    <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief
    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
    ==================
    "davidhelp" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a table with 3 columns with one row above and
    below
    > Text in left and right column is aligned to the top but
    in the middle
    > column
    > the text will not align to the top. In IE it is correct
    but in Firefox 1.6
    > it
    > is down by 1 line
    >
    > How to correct?
    >
    > David
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    > "
    http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    > <HTML
    > xmlns="
    http://www.w3.org/1999/xhtml"><HEAD><TITLE>BustedComputer</TITLE>
    > <META http-equiv=Content-Type content="text/html;
    charset=iso-8859-1" />
    > <style type="text/css">
    > <!--
    > body {
    > font-family: Verdana, Arial, Helvetica, sans-serif;
    > font-size: 11pt;
    > color: #000000;
    > margin-left: 0px;
    > margin-top: 0px;
    >
    > }
    > table, td
    > {
    > border-color: #000000;
    > border-style: solid;
    > }
    > table
    > {
    > border-width: 0 0 1px 1px;
    > border-spacing: 0;
    > border-collapse: collapse;
    > }
    > td
    > {
    > margin: 0;
    > padding: 10px;
    > border-width: 1px 1px 0 0;
    > vertical-align: top;
    > }
    > a:link { color: blue; text-decoration: none }
    > a:active { color: blue; text-decoration: none }
    > a:visited { color: #0000FF; text-decoration: none }
    > a:hover { color: blue; background-color:#FFFF9D;
    text-decoration:
    > underline }
    >
    > -->
    > </style>
    > </HEAD>
    > <BODY>
    > <TABLE cellSpacing=0 cellPadding=0 width=800
    align=center border=0>
    > <TBODY>
    > <TR>
    > <TD colSpan=3 bgcolor="#6699FF">Top</TD>
    > </TR>
    > <TR>
    > <TD width="150" bgcolor="#6699FF"><a
    href="#">leftside</a></TD>
    > <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief, Lorem Ipsum is
    > not
    > simply
    > random text. It has roots in a piece of classical Latin
    literature
    > from
    > 45 BC, making it over 2000 years old.<br>
    > <br>
    > Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of
    "de Finibus
    > Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero,
    > written
    > in 45 BC. This book is a treatise on the theory of
    ethics, very
    > popular
    > during the Renaissance. The first line of Lorem Ipsum,
    "Lorem
    > ipsum
    > dolor
    > sit amet..", comes from a line in section
    1.10.32.</p>
    > </TD>
    > <TD width="150"
    bgcolor="#FFFFCC">rightside</TD>
    > </TR>
    > <TR>
    > <TD colSpan=3 bgcolor="#6699FF">Bottom</TD>
    >
    </TR></TBODY></TABLE></BODY></HTML>
    >
    >

  • Need Help about Vertical Align in TLF-

    I have added an InlineGraphicsElement in TextFlow which has some text in it. and i want to align the text verticalAlign.MIDDLE. ie. the text should be vertically aligned middle to the InlineGraphicsElement. rite now its bottom aligned. how can i make it to middle aligned like the attached image. please help me..?

    sabre150 wrote:
    So what makes you think that not using StringBuffer is the cause of the OP's problem?Just by experience. The main cause of resource hogs in Java is large string concatenation enclosed in a loop.
    I've just made the following experience :
    public class Test {
        public static void main(String[] args) {
            new Test().execute();
        private void execute() {
            long a, b, c;
            String value = "A123456789B123456789C123456789D123456789";
            String reply = "";
            StringBuffer buffer = new StringBuffer();
            a = System.currentTimeMillis();
            for (int i = 0; i < 5000; i++) { reply += value; }
            b = System.currentTimeMillis();
            for (int i = 0; i < 5000; i++) { buffer.append(value); }
            reply = buffer.toString();
            c = System.currentTimeMillis();
            System.out.println("Duration - concatenation = " + (b-a) + " / string buffer = " + (c-b));
    }Output :
    Duration - concatenation = 21295 / string buffer = 7

  • Losing table vertical alignment when converting ditamap to book

    FrameMaker Version: 12.0.4.445 (latest, part of TCS5)
    I have a structured project, where several XML files have been arranged into a ditamap.
    For one of the XML files, I have a table, where I need to set Cell Vertical Alignment of the cells to MIDDLE.
    So using Paragraph Designer > Table Cell, I change the entries from Top to Middle (The defaults were Top).
    With the ditamap pane selected, I then go File menu >> Save Ditamap As
    I save the ditamap as "Book 12.0 with fm components (*.book)" file type.
    In the resulting book, the XML files are now .FM files.
    However, at this point, when I open the .FM file that has the table, the cell styles have reverted to TOP.
    I've searched high-and-low for a similar issue. This is looking like a bug to me, but can someone confirm?
    Thanks

    (Perhaps the moderator should move this to the FrameMaker Integration discussion (under RoboHelp).
    I've determined the correct settings for my purposes, that being vertical alignment in a FM-to-RH integration project. I originally thought it was specifically a FrameMaker issue, though the solution also involves settings in RoboHelp. Here are my findings:
    1. For the selected FM table, note its Table Tag in the Table Designer (e.g., FormatA). This will be used later.
    2. If there is table Entry > Image element, then select the Image element, and set its placement attribute = inline.
    Though inline is supposed to be the default, I found it necessary to state explicitly in order to control alignment of image within a RH table cell.
    3. Moving on from FM, in the CSS file that you are using with your RH project, suppose that you have defined your table as follows. Note that I'm using "CenterMiddle" as the title.
    table.CenterMiddle {
      width: 100% ! important ;  /* This forces the RH table to autofit the window */
      text-align: Center;
      font-family: "Adobe Garamond Pro";
      border-left-style: Solid;
      border-left-width: 1px;
      border-left-color: #000000;
      border-right-style: Solid;
      border-right-width: 1px;
      border-right-color: #000000;
      border-top-style: Solid;
      border-top-width: 1px;
      border-top-color: #000000;
      border-bottom-style: Solid;
      border-bottom-width: 1px;
      border-bottom-color: #000000;
    .CenterMiddle td {
      vertical-align: middle ! important ;  /* This forces the individual cells to align vertically */
      border-color: #000000;
      border-style: solid;
      border-width: 1px;
    4. Go to the RH project to which the FM project is linked.
    5. Go File menu > Project Settings.
    6. In the FrameMaker Document group, click Edit.
    7. Under FrameMaker Settings, locate the Table style that you noted in step (1), and set it to the name of your table from (3).
    At this point, you can update all the FM components in your RH project, and compile the RH project to get the desired results. In my case, I needed both text and images in the table cells to have vertical alignment = middle.

  • How do I vertically align paragraphs in a page?

    I am new to Pages, and I've run across a problem that is really aggravating because it should not be rocket science... but it seems to be, at least for me.
    I need to center the text on the page so there is equal white space above and below it.
    In Word, you select File --> Page Setup --> Layout --> Vertical Alignment and choose "Center." Done.
    How do you do this Pages? I've scoured the manual and online help and can find nothing on this.
    Thanks in advance!

    Note that the Vertical Alignment does not apply to the Text Layer of a Word Processing document, just to the text in objects that accept text within the shape. For your application you would probably want to add a text box, centered on your page, to hold the text that you want to center.
    Regards,
    Jerry
    Message was edited by: Jerrold Green1

  • Vertical alignment in cross-tab

    Hi,
    Anyone of you know how to align the measures Vertically Centered In Cross-tab report? As far as i know, there is option for Horizontal alignment; but no options for Vertical alignment. By default the text are docking on top aligned!!!
    Help me out to solve this or any work-around to achieve this?
    Thanks in Advance
    Viswa

    Hey Anindita,
    I was not asking about the text orientation. I want to align the text in the cross tab report to be vertically aligned center.
    I want the text in each cell should be aligned centered both horizontally as well as vertically. Horizontal alignment is available in cross tab formatting but not for the vertical alignment.
    Thanks
    Viswa

  • Vertical alignment in table cells not working in generated output

    Using RH9 WebHelp. I have created a simple table style. Because I could not find out how to make cell vertical alignment (top, center, bottom)  part of the style definition, I have been applying it manually to individual whole tables using the cell alignment properties.
    This worked fine for a while, but at some point I noticed that even though the tables look right in Design view, with top-aligned cells contents, it gets hosed in generating output and all tables now come with vertically centred cell contents even through the in-line formatting for top alignment is still there in the code.
    Any ideas?

    Hi Mike,
    I'm confused to where you applied the vertical alignment. Normally, I would set this for the table cells and not the table.
    CSS has indeed an order in rendering: There is a point system for determining the CSS to apply. See http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-understanding-css-specific ity/ for a short introduction.
    And as an extra to the point system, the place where the styling is present, also determines the styling. Browsers use the following hierarchy (in descending order)
    User style sheet defined in the browser.
    Inline styling.
    Style block in page.
    External style sheet
    You can overwrite styling from a lower order using the !important declaration. You can use this to make sure that inline styling will not be able to overwrite styles from your style sheet. (Unless the inline styles use !important themselves.) Example:
    table.mytable td {
         vertical-align: middle !important;
    This will make all the content of table cells in the table with the class mytable to be vertically centered.
    Greet,
    Willam

  • Vertical alignment

    <div class="content">
      <div> (css attribute float : left)
        <img>
      </div>
      <div> (css attribute float : left)
        <table>  (I need this table to align vertically with the image.)
                     (vertical-align : middle   doesn't seen to do anything)
      </div>
    </div>
    I've tried encasing the table in another div and set THAT element to vertically align.
    What am I missing?
    Dana

    Copy & paste this code into a new, blank document.   This layout uses CSS display:table properties to which you can add vertical-alignment.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 Layout with Display:Table Properties</title>
    <style>
    body {
    font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
    font-size:100%;
    font-weight:bold;
    background: #FFF;
    width: 90%;
    margin: 45px auto;
    display: table;
    border: 4px solid #90F;
    /**optional rounded borders**/
    -moz-border-radius: 15px;
    -webkit-border-radius: 15px;
    border-radius: 15px;
    section {
    display: table-row;
    background: #FFF;
    margin: 0;
    width: 100%;
    aside.one {
    width: 33%;
    padding: 0 2%;
    background: #F60;
    color: #FFF;
    display: table-cell;
    vertical-align: top;
    aside.two {
    width: 33%;
    padding: 0 2%;
    background: #9F0;
    color: #000;
    display: table-cell;
    vertical-align: bottom;
    aside.three {
    width: 33%;
    padding: 0 2%;
    background: #F09;
    color: #FFF;
    display: table-cell;
    vertical-align: middle;
    </style>
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <body>
    <header>This is header</header>
    <section>
    <aside class="one">
    <p>Aside .one has vertical-align:top. </p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Vestibulum gravida metus eu metus elementum in rhoncus nisi cursus.
    Donec hendrerit condimentum ipsum, in sodales dui rhoncus non?
    Nulla facilisi. Nulla porta, dolor et suscipit elementum, sem sem viverra
    arcu, et aliquam elit leo porttitor urna. Praesent tristique lacus a metus
    pharetra quis pharetra sapien laoreet. Nam tempor pharetra magna nec luctus.</p>
    </aside>
    <aside class="two">
    <p>Aside .two has vertical-align:bottom.</p>
    </aside>
    <aside class="three">
    <p>Aside .three has vertical-align:middle.</p>
    </aside>
    </section>
    <footer>This is footer</footer>
    </body>
    </html>
    Here's a screenshot:
    Nancy O.

  • Vertical-align

    アマチュアの者です。
    Dreamweaver8を使っています。
    cssで「vertical-align」を記述しても反映されず困っています。htmlで「vspace」を記述すると反映されます。
    よろしくおねがいいたします。

    「vertical-align:middle;」を記述しても反映されず「vspace」で上下均等になるような値を記述した、という意味です。

  • Vertical alignment of text in a cell doesn't work

    In Numbers 3.2, the vertical text alignment seems to have no effect on the text. Whether I select the text itself, the cell, or the row, pressing one of the vertical alignment buttons for top, middle, or bottom does nothing.
    I've searched through all the menus but I don't see anything to affect this. Alignment in the menu is of the left, right, justify variety, not top, middle, bottom.
    My goal is to reduce the padding in a row so that I can squeeze the text right up to the cell borders, but Numbers doesn't seem to allow me to do this. Yet I have someone else's number sheet, and it's obviously possible since they have it in their sheet.
    Thanks for any help,
    Confused newb

    AlizaG wrote:
    Annoyingly, when I searched for my question I was only shown questions that were not related to this one. Now that I've posted it, the related questions are shown in the sidebar and lo and behold: other people have had this problem too...
    The culprit is the automatic text inset of 4 pts. Drastically un-intuitive.
    Aliza,
    Only un-intuitive if you believe that most people would like their cell content lying right against the cell border.
    Jerry

  • "Vertical Align Center" Text and a Shape

    Hi designers,
    I wonder if anyone could give me a hand with aligning text and shapes? I would like to align a number to the center of a circle. "Horizontal Align Center" works well. "Vertical Align Center", however, does not yield the desired result. The number turns out to be higher in the cycle (see figure below). The distance from the top of the circle to the top of the number zero, X, is shorter than the distance between the bottom of the circle and the bottom of the number zero. Is it possible to equal these two distances?
    Figure 1: The Outcome of Vertical Align Center
    Thanks,
    Haobo

    Hi Mylenium,
    Thank you very much for you very prompt reply, which solves the problem very effectively.
    If you do not mind, I have got two further questions.
    Firstly, is there an option similar to "Align to Path: Centre" under "Type on a Path Options" that changes how text is aligned?
    Secondly, does InDesign offer the aforementioned function?
    I sometimes label a large quantity of locations with alphanumeric characters, which are subject to frequent changes, and therefore would like to preserve the text if possible. I have heard that manipulating text is InDesign's area of expertise. If this function is not available in Illustrator but offered by InDesign, I can jot down another reason for acquiring the latter and split the workflow in the future.
    Thanks,
    Haobo

  • Vertical alignment in text form

    Been trying set vertical alignment so that text will align with the top of the form box, and having a frustrating result. It will only align if the box is one line only.
    A multi-line box will not expand vertically to accomodate long text; an expanded (vertically) box will result in text beginning below top alignment. Anyone working on a fix for this? It seems to be a new problem, as I have used this feature with in the past with old versions of Acrobat.

    If I understand your issue correctly, you can achieve this by playing witht the Left and Right values under Layout tab of the object properties.
    Let me know if this is not what youare looking for..
    Thanks
    Srini

  • Vertically align text

    Hi
    Is it possible to vertically align text within a frame?
    Thanks

    Wade_Zimmerman wrote:
    I really do not think there is a reason to do this but if the OP has a good reason or wants to tell us why they need this we might be abe tooffer them a better way.
    I searched for a solution to this myself and missed this thread before i posted my own thread. but I find it odd how when this is asked for people are asked to give a good reason to use the bounding box, or like here told that there is no reason to need this. Well here is my current situation.
    I have a project that has 500+ peices. I am using data sets and variables.xml  to create them all quickly.
    Each one consists of a 1 of  three logos and 1 of 500+ lines of text and all the lines of text are  different lengths
    Now the problem I am having is getting the  text to wrap properly instead of running off the art board. This was easilly solved by using a text box. Now I am faced with a new issue, One line texts are all sitting really high on the artwork.
    So I would like to center all text vertically inside the box

  • How to vertical align Text Layers at baseline

    Hi,
    what do i have to do, to align a few Text Layers vertical, based on the baseline of the text? I have my Text Layers for a Navigation and can't use "Align bottom edges" because one word has a "g". I've a screenshot attached. I didn't find a solution when searching the web.
    Mario

    Only thing I can suggest is to create a guide and then you can move the text block to the guideline, and it will snap to the text baseline.

Maybe you are looking for