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
>

Similar Messages

  • - 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 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.

  • How to vertically center text in table cell?

    How do I get text to center vertically in a cell?

    It centres all the text, no matter how many lines. I test the solution.
    What have you done? Explain what you are getting and exactly what it is you have done and the result you wanted. We can't see your screen.
    Peter

  • 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

  • How do you center a title's anchor point?

    I'm sure this is a simple question but I can't find anything in the forums that answer it.
    I have a text title I want to center in the frame (horizontally and vertically, with text center aligned), but for some reason the guides seem to be wrong.  The yellow lines don't meet at the center of the frame, they meet at another point that seems to change randomly.  And the round handle (anchor point?) of the text box appears on the first line of text, rather than the vertical center of the text box.  How do I reset this or change it?  It says my anchor points are at  x 0 y 0, but that doesn't look right.  All I want to do is center all my text boxes (both horizontally and vertically) within the frame.  I hope this makes sense.  Please see images.  Thanks!

    Are you sure that your settings in Video Inspector - Transform - Position  x =  0, y = 0 and not something else?
    I don't think you can set the move handle to be other than under the first line.
    Geoff.

  • Vertical Center a Page

    I can horizontally center a page with:
    $("#Stage").css("margin","auto")
    How can I vertically center a 960px x 580px Edge Page (Stage)?
    Thanks for any help

    Hi Mario,
    The only way to achieve this is by using anchors. There is no way in Muse to do so. For more info, Please refer to the following link Re: How can I have an anchor used as my home page?
    Regards,
    Aish

  • Center and Vertical Center Align an image

    how can I center and vertical align an image so that it stays center and vertically aligned in the middle and on all devices???
    Simply put I would like the image smack in the middle of every screen it is viewed on.

    Try this
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body {
        background-image: url('yourimage.gif');
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center;
    </style>
    </head>
    <body>
    </body>
    </html>

  • Why my Dock is always on the LEFT at the bottom. How can I center it?

    My dock is on the LEFT side at the bottom. How can I center it?

    Welcome to the Forums!
    Location is set in System Preferences > Dock. It should be centered, either centered horizontally if placed at the Bottom, or centered vertically if placed at the Left or Right.
    I take it you have it set at the Bottom, and it's along the bottom but over to the left side?
    Try deleting the file "com.apple.dock.plist" from ~/Library/Preferences.
    Hope this helps...

  • Is there a way to vertically center text / elements?

    Please help on this

    Hi Gupevieira,
    This would depend as what and where you exactly want to align page items. Examples being:
    1) To align the content on the Muse canvas, you may refer to the following link:
    How do you center objects and or a website vertically and horizontally in Muse?
    2) To fix certain content on the browser window, you may center it as in the above scenario, and use the Pin feature to fix it in the browser.
    3) To align some text vertically in a text frame, you may refer to:
    Need Help with Text Alignment
    4) To align with reference to other content, you may you the Align panel (Window->Align)
    Additionally , you can use padding/gutter value for spacing in respect to alignment in spacing panel, similarly Align panel can be used to align objects on page accordingly.
    If this is not the answer you are looking for then please provide more details as what you are trying to achieve , screenshots would help.
    Regards
    Sonam

  • Vertically Center Text in a Text Box

    Just switched form Acrobt 6 to Acrobat Pro 9 and can't figure out how to verically center text in a text box.  When I select the text it gives me the properties bar shown below:
    Seems like a really dumb question because I know I could in Acrobat 6 and I don't know why they would take away that feature, but I can't find it anwywhere.

    The only time the More button is enabled is when I have the Text Box selected, and then the options pertain to the line weight, etc. of the box and not the text.  When I select the text the More button is not enabled and the only options properties are the ones shown above.
    I made the Text Box by going to "Tools", "Comment & Markup", "Text Box Tool".  I have not seen anything that says Multiline and when I searched help it only talked about multiline fields in forms.
    Thanks for the quick responses.

  • 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 can I center it in the cell (above big sub-table)

    The "Cross Browser marquee II" at
    http://www.pafoscarhire.com/index.php
    how can I center it in the cell (above big sub-table) ?
    I try but layer goes to the center of page rather than center
    of cell , well ?

    Heh - can't imagine what that's about....
    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
    ==================
    "Walt F. Schaefer" <[email protected]> wrote in
    message
    news:f53j7t$asj$[email protected]..
    >I got the same error Murray. And, I might add it was not
    centered. ;-)
    >
    > --
    >
    > Walt
    >
    >
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:f53itb$adt$[email protected]..
    >> Internal Server Error
    >> The server encountered an internal error or
    misconfiguration and was
    >> unable to complete your request.
    >> Please contact the server administrator,
    [email protected] and
    >> inform them of the time the error occurred, and
    anything you might have
    >> done that may have caused the error.
    >>
    >> More information about this error may be available
    in the server error
    >> log.
    >>
    >>
    >> --
    >> 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
    >> ==================
    >>
    >>
    >> "123polis123" <[email protected]>
    wrote in message
    >> news:f539js$9d$[email protected]..
    >>> The "Cross Browser marquee II" at
    http://www.pafoscarhire.com/index.php
    >>> how can
    >>> I center it in the cell (above big sub-table) ?
    >>> I try but layer goes to the center of page
    rather than center of cell ,
    >>> well ?
    >>>
    >>>
    >>
    >>
    >
    >

  • How do I center text in a JTextArea?

    Easy question! how can I center text being fed into a JTextArea?
    Thank you!!!!!!!!!!!

    Thanks for the reply. You seem to know swing pretty well. Is there a way to change the color of my actual font in a JText Area?
    Thanks again!!!!!!

  • How do I center text in Final cut Pro?

    Hi, does anyone know how to directly center text with more than one line of text in Final Cut Pro?
    If I have more than one line it doesn't seem to center properly. I've tried wireframe (which is inaccurate), center values (which doesn't work) and Boris 3D (which does the job but the space between letters isn't accurate so I need to try an alternative method).
    Any ideas?

    In Title 3D you use the Position X/Y button to adjust the height. The spacing between the letters in Title 3D can be adjusted both in tracking and in kerning by placing the cursor between a letter pair. Title 3D is perhaps one of the most accurate and precise text positioning titlers available in any software.

Maybe you are looking for

  • IPod touch 1st gen software problem

    I followed the link straight from the apple site to download 3.1.1., but I couldn't get it to go onto my iPod touch first generation. I tried another computer, but it says my ipod has the "current" software 2.2.1. But when i plug it back into my prim

  • Repeated update to Remote Desktop 3.8.2 v1.1

    On my iMac I received 3.8.2 twice on the 27 Jan and then 3.8.2 v1.1 on 6 Feb, but on my MacBook Pro i received v1.1 3 times now, the latest being this morning the 9th. Why am I continuing to get this update and is it the same thing or has Apple kept

  • Error using OLAP Bridge

    I have recently began trying to use the OLAP bridge to transfer data from OWB to be used by BI Beans applications (ROLAP, not MOLAP/AW). I have set up the bridge to run, but I always get the following error on my first dimension. Am I missing a step?

  • Parsing Idocscript Variables in XML

    I would like to parse Idocscript variables inside a regular xml file. When I say regular I really mean a non "Data File" from within Site Studio. Below is a snippet of the xml file I'm using. As you can see, I am trying to use the [!--$ssServerRelati

  • Illustrator CC 2014 Image Auto Embedding Problem

    So this happened a lot in previous versions of Illustrator and I could trash my extensions and fix everything. Problem: when I place images, it will automatically embed placed images, making my file sizes huge. Seems to do it more with PSD files, wan