Font Size of Dynamic Text Box is not consistant

Posted on 2004-11-12
Last Modified: 2013-12-03
In short, I have two Flash applications.  One where a user can add and manipulate text.  A user can change the font size.  That font size is recorded is recorded in an XML document.  

Later a seperate Flash file reads the XML to duplicate what the user created.

My problem is that the font size is not remaining uniform.  The user might choose a 12 pt font.  In the other flash file a 12 point font is much bigger.  In both cases the Dynamic Text box is manipulated using:


I know the code is effectively formating the text box.  In the second application I have to make set the font to 7 pt to closer resemble the first 12pt font.

This application demands that the text look exactly the same from one aplication to the next, but the font size simply isn't constant.

Any ideas would be GREATLY appreciated.  I'm just hoping this isn't another Flash anomoly here.

Question by:jasonrlee
    LVL 10

    Expert Comment

    Probably has to do with the fonts available on each system.  The only solution I'm aware of is to embed the font.  Either select your text box and select "character" in the properties panel (you can then select which characters to embed).  Or you'll need to add a font in the library if the textbox is created dynamically.

    Go to the menu for the library and choose "New Font" and select the correct font.  Size isn't a large issue with most fonts, primarily just pixel fonts.  Once that font is in the library you can set the linkage for it and then use the code:

    That should embed everything, if you have any questions or if I'm way off the target let me know and we'll give this another go round.

    Author Comment

    I wish that was the answer but I implimented it without change.  Actually I've already simplified the whole thing to only using Arial so I wouldn't think there would be issues at all.

    I am absolutely open to any other thoughts you might have.  At this point I will try anything.  Until there is another idea I will double check to see if I implimented this correctly.
    LVL 10

    Expert Comment

    Assuming that both are Windows systems (which may be a bad assumption) you can check in the display properties (right click on the desktop, go to properties), and on the settings tab, click advanced.  There on the general tab check the font size.  If they are different that might give us an indication why this is happening (though I wouldn't know of a workaround).  Truthfully I'm not sure if that setting would make a difference within flash or not, so I might be barking up the wrong tree entirely.  I have too many things up right now to reboot my system or I'd check for a change myself.
    LVL 6

    Expert Comment

    have you tried with fixed font size instead of the fontsize from the XML file? or just try with dummy XML file with two nodes with same font sizes...

    Author Comment

    To answer Savong first,  I created both flash files on the same computer.  Both files were placed on a server and I am testing both files from the same Windows computer.  So there is no change in platform from one flash file to the next.  Regardless of the windows settings the font size should be consistent from one Flash application to the next.

    To answer Nishasrikankan, I actually negated pulling the font value from the XML at all and set the Dynamic text box to 12pt.  Even without the XML the 12pt font is different from one Flash to the next.

    I am still open to absolutely any additional thoughts here.
    LVL 14

    Accepted Solution

    I'll just ask a question 1st, this may seem unlikely but, did you resize the text box using the Free transform tool? If you did then there's your problem

    Author Comment

    Yes, after much frustration I just figured that out last night, but I'll give the points to you anyway.  

    This is ridiculous.  For others I will expand on what is happening.

    Open the Transform panel.  Use the text tool to draw a dynamic text box.  When you first draw it and click on it with the transform tool it reads 100% for Height and Width.  If you were to shrink or enlarge the height of the box only, when you publish/preview the flash your text gets Bigger!!!  Therefore if you don't have 100% for both height and width your 12pt font is not true to size, and will scale larger or smaller.  This completely negates the purpose of having a font size in the first place, and makes not sense to me.  Why can't I draw a text box of a specific size, with a specific font, and actually end up with the right font size?

    Now I just have to figure out how to make a dynamic text box of a specific size and still keep the 100% perspective.  If I am missing some aspect of this let me know.  Otherwise I'll muddle through it.  Thanks everyone for trying.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now