Font Size of Dynamic Text Box is not consistant

Posted on 2004-11-12
Medium Priority
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

ID: 12571066
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

ID: 12571262
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

ID: 12571354
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.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 12572899
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

ID: 12574549
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

trigger-happy earned 2000 total points
ID: 12577966
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

ID: 12579599
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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses
Course of the Month15 days, 5 hours left to enroll

840 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