Flex :: Ensure That Text Elements Are Truly Aligned To The Vertical Middle?

Sep 13, 2011

If I want to align things vertically in a container, I'll use verticalAlign="middle", but this doesn't exactly solve the problem of truly aligning text vertically. Text is always too high vertically, so in the past, I've just adjusted paddingTop and paddingBottom to compensate, but that doesn't work as the font for _sans differs from operating system to operating system.

Given the following layout code, you'll see the problem:

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code]....

What happens is pretty clear. The horizontal line gets aligned to the exact middle of the box, but the text is offset by some arbitrary amount. I assume that this is because of the text baseline alignment or something. Is there a way to fix this regardless of the font size and face? I'd like to have the line essentially go right through the middle of the text, ignoring the extra space possibly needed for below the logical line of text (ie: ignore the bottom part of "g's" and "j's" when laying things out).

View 3 Replies


Similar Posts:


Text Not Aligned In Vertical Center Of Text Field?

Jul 10, 2009

I am having a problem with my text alignment and I can't figure out a way to correct this. Unfortunately, I'm using a mac with CS3 and a Windows computer with CS4, so it could either be an OS difference, a version difference, or a software bug which I can't figure out.

For some reason, the text on my Mac with CS3 are not in the vertical center of the text fields. This causes a problem with my "align vertical centers" alignments, meaning I've had to do the alignment by hand to get it to look right. When I moved my file to my laptop to keep working on my project at home, I noticed that the text alignment was correct on my laptop, causing all of the text placement throughout my document to be off. This means that I can only work on the one computer and can't bring the project home to work through the weekends.

I have made an image showing the difference of how the text is aligned on the two versions, and a sample of how it affects my project when i bring it between computers.

I made the file on the mac (CS3) first, and so the alignment is designed to look correct on there. When i bring it to the PC (CS4) the text shifts down, placing it back in the center of the text boxes and ruining the alignment.

When I publish the file it keeps the formatting of each system. IE - publishing on the mac makes the final product look like it does on the mac, and publishing on the windows computer makes it look like it looks on the windows computer. The file published from the mac has the mac alignment on both computers, and the file published from the pc has the alignment of the pc on both computers.

View 12 Replies

Flex :: Flex4 - Ensure CutOperation Puts The Cut Text On The Clipboard?

Sep 30, 2010

I have a class that inherits from EditManager and provides these methods:

public function performCopy():void
{
var copyOperation:CopyOperation = new CopyOperation( getSelectionState() );

[code].....

View 1 Replies

Flex :: Insert Text In The Middle Of String

Mar 18, 2010

can you please help me with this issue the String class does not have insert method it has only replace :( .

what I need is:

- if I have string "I stackoverflow"
- I need to insert "love " at index 2 to have "I love stackoverflow"

so what I need is insertAt(index, String)

View 2 Replies

Flex :: Adobe - How Do I Ensure A Flex DataProvider Processes The Data Synchronously?

Nov 12, 2011

I am using an component, and currently have a dataProvider working that is anArrayCollection (have a separate question about how to make this an XML file... but I digress).Variable declaration looks like this:

[Bindable]
private var _dpImageList : ArrayCollection = new ArrayCollection([
{"location" : "path/to/image1.jpg"},

[code]....

View 4 Replies

ActionScript 2.0 :: Underlined Text Is Not Aligned Properly

Dec 21, 2009

I am trying to apply a new text format to my text field on a movie clip onRollOver. The new text format is properly/correctly applied when I moused over, and the main difference that is applied onRollOver is to have the text underlined. The only problem I'm having with this is that the actual underline itself appears to be about two pixels to the left of my text string so it looks like its not aligned properly with the text.[CODE]...

View 0 Replies

ActionScript 2.0 :: Blury Center Aligned Text?

Oct 13, 2005

I am having a problem with center aligned dynamic text (externaly loaded, css formatted,pixel fonts, embeded) I am using pixel font. I think the problem is not with the font. When I place the text box on the stage and manualy align it center - text is not blury.But since text is loaded from html and it is css formatted I have to center align it in my css file

View 1 Replies

ActionScript 2.0 :: [FMX2K4] Text Aligned Along Bottom Of The Box?

Apr 27, 2004

I have a text box that is 100x100. How can I make the text start aligning along the bottom? So if I have 1 line of text its on the bottom of the text box, if I have 2 lines of text...its the bottom 2 lines of the text box, if i Have 5 lines of text...it takes up the whole box, starting from the top?

View 1 Replies

ActionScript 2.0 :: Use Math.Round To Ensure That ALL Text Boxes Are On Whole Number, X,Y Coordinates?

Apr 20, 2004

Is there a way to use Math.Round to ensure that ALL text boxes are on whole number, X,Y coordinates?

View 4 Replies

Flex :: Ensure That The PopUp Always Displays Above The PopUpButton?

Apr 2, 2012

Few users of my Flex 4.6 web application are complaining, that the mx.controls.PopUpButton at the right bottom corner of it sometimes opens a List underneath it and is thus unusable (I can't reproduce that myself - probably an unlucky combination of their Flash player and/or font size setting?)

How could I ensure, that the popUp component (in my case it is a spark.components.List) always opens above the PopUpButton?

I suspect, that I should create a skin based on mx.skins.halo.PopUpButtonSkin and assign it to my PopUpButton? And I probably should use the PopUpPosition.ABOVE constant together with the PopUpAnchor?

I have prepared a screenshot and a simple Text.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"

[Code]....

I still can't reproduce the bug myself, my users aren't very helpful (mostly older folks, playing my card game). I've searched in Adobe JIRA, but couldn't find such a bug.

I wonder, if there is a way to short-circuit that method to enforce opening the popUp above the PopUpButton.

Or if I should put the _list into some container...

View 1 Replies

Actionscript 2.0 :: Get Vertical Dynamic Text Block By Setting To Vertical And Then To Dynamic

Jun 17, 2009

i found i can get vertical dynamic text block by setting to vertical and then to dynamic. But, then it ends up being horizontal, and if inside a clip, only the letters over another item in clip show. Like veritcal text on a vertical bar gives only the 1 or 2 letters that fit across bar, rest truncated. i've tried embedding text to get this far, but still doesn't work 'all the way' i see online they talk about all scripting for dynamic, vertical text; is that necessary, or am i missing something??

View 1 Replies

ActionScript 3.0 :: Flex Scrolling Through List Causes Text Elements To Scroll To?

May 12, 2010

I'm using a list element with variableRowHeight and word-wrap set to true like in the example below:

[URL]

When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of the textField...

View 1 Replies

Flex :: Ensure An Item Gets Deleted Inside Repeater?

Aug 4, 2010

I have a code like this:

<mx:Repeater id="allItemRepeator"
dataProvider="{_model.allItems}"
>
<components:ComponentSelector id="componentSelector"

[Code]....

When code changes for allItems the item disapears from screen as expected but still sits in memory! I know this by a function inside a compoenent that has "trace" so the trace output still displays even after the component disappears from screen. How do I ensure that the element is deleted when it's reference is deleted? Will using List-based component to display items instead of "Repeator" solve the problem (it requires significant refactoring of my code so I'm asking before trying it out)

View 1 Replies

Actionscript 3 :: Design Layout Such That All Labels And Text Boxes Will Be Aligned Properly

Dec 1, 2010

I want to design a registration form using only ActionScript, i have designed labels and text boxes but using label.x = "10" label.y="40" text.x = "50" text.y ="40"... to align correctly. But i want to design a layout such that all labels and text boxes will be aligned properly.

View 3 Replies

Flex :: Make Columns Aligned Between 2 DataGrids?

Nov 9, 2009

I have 2 advanced data grids, one above the other. They both have the exact number of columns, and pertain to each other in the same way. But each is showing different data, which is why I split into 2 grids. However, on each one you can resize the columns, what I would like is to make it so that if you resize a column on either datagrid the same column on the opposite datagrid resizes as well, so they are both always lined up.

View 1 Replies

Flex :: Add First Child Vertically Aligned With Label?

Sep 22, 2010

In flex form layout

<mx:Form id="form">
<mx:FormItem label="horizontal:">
<mx:Text text="test"/>
</mx:FormItem>
</mx:Form>

the output will be

horizontal 'test'

But my constraint is i want to align the textbox(first child of the form item ) vertically with the label. How can i do this?

View 2 Replies

Adobe - Ensure A Flex DataProvider Processes The Data Synchronously?

Aug 12, 2009

I am using an component, and currently have a dataProvider working that is an ArrayCollection (have a separate question about how to make this an XML file... but I digress). Variable declaration looks like this:

[Code]...

View 1 Replies

Flash: Align Text In Dynamic Text Control Vertically To The Middle?

Feb 14, 2011

is possible to align text in dynamic text control vertically to the middle? In flash CS3.

View 1 Replies

Actionscript :: Flex : Ensure That Events All Travel Down One Object Tree, Regardless Of Target?

Mar 5, 2011

I have numerous objects, many of them are stored within other objects (and overlap in physical space). As I zoom into an object, it begins to fade away. At the moment it begins to fade, I load in the child object (or create a child object if one doesn't exist). I want to turn off the parent object's ability to respond to most events. The exception is the scroll wheel, which needs to be sent to both objects simultaneously so that the parent can continue to fade out as I zoom farther in. Try as I might, I can't find a way to tell Flex "hey, for right now dispatch these types of events ONLY to this object." I either end up with event dispatch stack overflows from trying to manually redirect the events, or I get events that don't activate at the correct time or on the correct object. What can I do?

View 1 Replies

Flex :: Align Vertical Axis Zero For Multiple Vertical Axis Chart?

Mar 22, 2011

Based on this Adobe multiple axis chart example: [URL]

Then I changed some data values to negative and my axis became not aligned anymore.

how to align vertical axis? Is this another Adobe bug or there is some property that aligns axis?

<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"

[Code]...

View 1 Replies

Vertically Align Middle Input Text In A Text Box?

Oct 2, 2009

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?

View 1 Replies

ActionScript 3.0 :: Flex Form Layout - Add First Child Vertically Aligned With Label

Sep 22, 2010

In flex form layout

<mx:Form id="form">
<mx:FormItem label="horizontal:">
<mx:Text text="test"/>
</mx:FormItem>
</mx:Form>

the output will be horizontal 'test' But my constraint is i want to align the textbox(first child of the form item ) vertically with the label. How can i do this?

View 3 Replies

Flex :: Custom Cursor Gets Overlayed By Vertical Ibar Cursor On Text Component?

Mar 18, 2010

I am making use of a custom cursor on itemRenderers in a List component. The custom cursor works just fine except when I mouse over the Text component which is a child of the itemRenderer at which point I get two cursors, the custom and an iBar one on top of the other.Here's the code:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>

[code].....

View 2 Replies

Flex :: Scroll Two Text Boxes With Single Vertical Scroll Bar

Jun 10, 2009

how can i scroll two text boxes with single scroll bar?

View 3 Replies

ActionScript 2.0 :: How To Take Out Text From Middle Of String

Jul 30, 2004

Is there a way to take out a part of the text in a string? Like start 7 characters inti the string and end 2 from the end of string. Something like:
string="hello how are you today?";
So when done weare done with it the things left in the text is:
"how are you toda".

View 5 Replies

ActionScript 3.0 :: Middle Text In TextField?

Feb 9, 2009

how can i middle a text in the Textfield that is 100px by 100px so that when i have 1 line its in the middle, when i have 2 lines its in the middle as well check attachment. when i do it right now it is always on the top i basically would need the same as when i have a HTML table by default so it is horizontal in the middle.

View 1 Replies

ActionScript 3.0 :: Position Text In The Middle Of Some Shape?

Oct 24, 2011

I have a problem with truetype font "DaxComp-Medi" and with some timeline and actionscript positioning. I have a mc in which I have another mc in which I have a circle in which I need to put the text in the center but that is not that easy.

Structure:

ActionScript Code:
mc1.mc.mc.txt
mc1.mc.mc.circle

[Code].....

So is there some way in as3 to get those numbers in the center of the (white) circles?

Do I need to convert the TextFields in to the BitmapData (how?), find positions of pixel that has some black color (How?), draw rectangle with that information, copy x and y point of the rectangle, center the rectangle in the circle, calculate offset x and y from the rectangles new position and add them the textfield x and y?

View 7 Replies

ActionScript 2.0 :: Takeout Text From Middle Of String?

Jul 30, 2004

Is there a way to take out a part of the text in a string?like start 7 characters inti the string and end 2 from the end of string

something like:

string="hello how are you today?";

so when done weare done with it the things left in the text is:

"how are you toda"

View 5 Replies

ActionScript 2.0 :: Tell The Cursor(vertical Text Flasher) To Jump To The End Of The Text In A Input Textfield?

Aug 19, 2006

how to tell the cursor(vertical text flasher) to jump to the end of the text in a input textfield - so that you can continue typing from the end of existing text?

View 5 Replies

ActionScript 2.0 :: EmbedFonts Makes Text Disappear - Dynamic Text Vertical Position?

Aug 7, 2003

I have the following code:

Code:
this.createTextField ("imageText",2,95,0,390,96);
imageText.multiline = true;
imageText.wordWrap = true;[code].....

The problem:If I uncomment either of the imageText.embedFonts lines, my text will disappear... but the trace(imageText.text); will still return the correct contents. It's as though embedFonts causes the textField to disappear.Possibly related, (but maybe not), is the fact that the vertical positioning of the font is off. Even though I create the textField at Y = 0, the text writes somewhere around Y = 10. I suspect this is something else, but I thought I'd add it just in case.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved