A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Text not aligned in vertical center of text field

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    7

    Text not aligned in vertical center of text field

    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.

    I hope that someone will be able to help me with this issue, and thank you in advance for your feedback!

  2. #2
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    Just to clarify, the way flash handles text fields on windows / cs4 is how I imagine it should be. I made the file on mac/CS3 however, and so when i said "ruins the alignment" I should have said "fixes the alignment problem, but breaks my alignment which was made to compensate for the problem I was experiencing."

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    Does anybody else on here use a mac? Is this a problem on anyone else's mac? Does it work fine for everyone else's mac computers?

    "Yes, this happens on my mac as well" would be helpful, even if you don't have a solution.

  4. #4
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    Am I asking this question in the wrong place? It's been over a month with zero replies.

    I KNOW somebody here has used text in flash. If you have, how does your text align in your field? Take a look at the image I posted earlier. Does it align like my "windows" example or the "mac" example?

    Is it just not possible to bring flash files from mac to PC or vice versa?

  5. #5
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Can you please embed the text and check the same. This is definetly some thing related to the way fonts are displayed and with flash the max you can do is embed the fonts and check.

    Its really surprising why this thread is lying with zero responses in a period of one month....but lets hope this never repeats again....lets make things better.
    As ever,
    Vinayak Kadam

  6. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    The root problem isn't that the alignment changes when bringing it back and forth (although as you can see it definitely is an issue), but rather that it isn't correct on the mac in the first place.

    I have made a new image to help illustrate what the issue is more clearly. I hope this helps.




    A response I received on the official flash forums, where I have also posted this:

    Yes, I have the same problem (you are not alone!). Seems like the fonts have a really huge vertical baseline shift. When I set a hyphen as Superscript (it's to do with a chemical structure project I'm working on), it aligns itself to the middle of the text... quite annoying. I haven't found a solution as of yet. Flash doesn't seem to allow much in terms of preference settings for this.



    It seems to be with all fonts too.



    '~'
    Last edited by Smef; 08-21-2009 at 11:58 AM.

  7. #7
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    have you tried embedding the fonts ?
    As ever,
    Vinayak Kadam

  8. #8
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    The fonts in the example in my first post were embedded.

    That doesn't have anything to do with the problem, though. Any time you write in a text field on this mac, the text is not positioned properly. I only moved the file back and forth to show the difference from how it should be to the way it is.

    The way this problem happens is:

    - Create new document
    - Add a text field (any font, static, dynamic, or input)
    - text is misaligned

    OR

    - Open existing document (created on any computer)
    - All text fields are misaligned (any font, embedded or not, static, dynamic, or input, even if they were aligned properly on another machine)

    ANY text field in ANY font in ANY document.

    This is a very base-level issue with the way this mac is handling text. I don't have another mac to test this on, so I'm hoping to hear from other mac users about whether or not they have this problem as well.

    The text fields always stay the same(x+y coordinates, bounding boxes of the field), but my mac is placing the text WITHIN the text fields incorrectly on any and every document, text field, and font.

  9. #9
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    Does anyone have any ideas about this problem? What that image helpful?

  10. #10
    Junior Member
    Join Date
    Dec 2000
    Posts
    4

    Had this issue for years and still trying to find a solution

    I've been dealing with this for years, the two platforms just do not align baselines the same way in Flash.. do not know why. Just decided to check again to see if anyone had found an answer and came across your thread.. I am assuming from the lack of responses that nobody else has found a solution either... ugh

  11. #11
    Junior Member
    Join Date
    Mar 2010
    Posts
    1
    Seems like a bug in Flash and CS4 still has it. I've used the same fonts in Word inside a table and it's able to center them no problems, but Flash does not center them, they appear at the top of the box.

  12. #12
    Junior Member
    Join Date
    Sep 2001
    Posts
    13
    Can the swf detect Mac/Pc...

    Then take the y position property and add 5 pixles?

  13. #13
    Junior Member
    Join Date
    Sep 2001
    Posts
    13
    This should work, basicaly detects pc/mac/linux then adds vertical space.
    ActionScript 2,
    text box has a instacnce name of "txtbox"
    Script finds the operating system,
    then if mac, finds the current Y position of the textbox,
    Then adds 50px to the current Y possition of the textbox. (so you can see it work)
    Cheers
    =)


    var os:String = System.capabilities.os.substr(0, 3);
    if (os == "Win") {
    // Windows-specific code goes here
    trace("pc");

    } else if (os == "Mac") {
    // Mac-specific code goes here
    trace("mac");
    setProperty("txtbox", _y, getProperty(txtbox, _y)+50);

    } else {
    // Must be Unix or Linux
    trace("linux");
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center