Groups | Blog | Home
all groups > flash actionscript > february 2006 >

flash actionscript : Dynamic Text Wont Display


sacrilage
2/25/2006 8:32:17 PM
So I am having this problem with dynamic text boxes that makes me want to throw
my computer off a 10 story building. I know everyone has had those
days....weeks? So anyway to the point.

I have a dynamic text box that I have either tweened, or put inside an MC that
is tweened. If I embed the fonts (which i want to do) the text does not
display; however, a trace of the text box reveals that the text has been
assigned to the field. As soon as I remove the embedded fonts, the text
displays - but we all know the quality of that... So, Im hoping someone here
might have some insight on why this happens, and how to fix it.

Any help would be greatly appreciated.
blemmo
2/25/2006 8:40:50 PM
I know this thing, made me mad too sometimes.
Try to embed 'All', that may fix it. I also had a case once where it didn't
want to display text because 'auto kern' was checked, so you may also try to
uncheck it.

hth,
blemmo
sacrilage
2/25/2006 8:57:27 PM
malachite00
3/12/2006 12:00:00 AM
Did you ever find a solution to this, or does anyone have any additional
suggestions? I am having the same problem. I have a dynamic text box that will
not display, even when fonts are embedded and I remove all tweening on the mc.
However, if I switch the text to Static Text, it displays fine. I have verified
that there aren't any items above it, and nothing else is on that layer.

Any help is greatly appreciated!

--amy
blemmo
3/12/2006 4:41:02 PM
Sometimes it helps to assign a variable to the textfield and assign the text to
that variable, and not to the 'text' property of the textfield. That's the last
idea I have regarding this...

hth,
blemmo
kglad
3/12/2006 5:06:40 PM
malachite00
3/12/2006 6:04:06 PM
Argh...I thought putting the font in the library was sufficient, but I hadn't
actually selected the embedded font to use in my textfield, or selected the
character embedding. I'm guessing the combination of these two things fixed the
problem. Thanks for the suggestions!
kglad
3/12/2006 6:29:53 PM
you're welcome. but if you're embedding a font via the properties panel,
nothing needs to be in your library. if you're embedding via actionscript, you
need to do several things (including adding the font to your library) to
successfully embed a font.
inchHigh
3/12/2006 10:28:46 PM
Originally posted by: kglad
if you're embedding a font via the properties panel, nothing needs to be in
your library. if you're embedding via actionscript, you need to do several
things (including adding the font to your library) to successfully embed a font.

I have had some problems along these lines that perhaps you could clear up.
If I have a dynamic text field (instance name button_label_txt) created in the
authoring environment that I click on embed and added all the salient glyphs,
it will work with antialias for readability nicely. But if I try to change the
format of this same dynamic text object via actionscript, for example to make
the font bold, using setTextFormat, the text disappears. Is this the expected
behaviour? If so how do I go about setting up a dynamic text field that I would
be able to modify to bold via action script?

I have also tried to add the font to the library (exported for actionscript in
frame 1, ID = tahoma_button) then used the following format statements:

rollOverFormat = new TextFormat();
rollOverFormat.bold = true;
normalFormat = new TextFormat();
normalFormat.color = 0x000000;
normalFormat.bold = false;
normalFormat.letterSpacing = 1;
normalFormat.font = "tahoma_button";
button_label_txt.embedFonts = true;
button_label_txt.setTextFormat(normalFormat);
butt_btn.onRollOver = function() {
button_label_txt.setTextFormat(rollOverFormat);
};


this will properly display the 'normalFormat' style, but it seems to ingore
the 'rollOverFormat.bold = true;' and not display the the font in bold.

Is there some trick to embedding both the normal and bold styles of a font for
use in a dynamic text field, short of embedding the font twice, once normal and
once with bold checked, and instead of using bold, switching the font?

thanks in advance,
iH
kglad
3/12/2006 11:23:22 PM
yes, that's expected. you need to embed the bold font, too if you want to use
it. if you wanted italic font you would need to embed that, too. and if you
wanted bold and italic you would need to embed that font also.

again, you could embed in the authoring environment (two textfields, one with
your font, non-bold embedded and one with your font and bold embedded) or you
could use actionscript to embed both fonts or embed one in authoring and one
with actionscript.
inchHigh
3/13/2006 12:33:28 AM
ok thanks for the clarification, that was what I was starting to suspect but I
was thinking it should be able to generate faux bold on the fly (as well as
italic) from the embedded normal font, seems strange that you would need to
embed both.
In any case, thanks again for the quick reply!
inchHigh
3/13/2006 1:07:19 AM
It would be handy if there were some checkboxes on the embed dialog for adding
the bold and/or italicized versions for use in actionscript.

Also is there a way of controlling what glyphs are added when you embed a font
via adding a font symbol in the library? Or is it all or nothing when you embed
this way?

AddThis Social Bookmark Button