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

flash actionscript : embedFonts


gleik.corvus
5/14/2006 6:46:55 PM
I am creating dynamically the following text filed (see script). I want flash
to embed the font but it is not doing it. When I set the "embedFonts" command
to TRUE the text doesn't come up when I rollover the buttons that send
dynamically the text variable to the text field.

Right now it works but the font that comes up it is arial and it is too big
and doen't brake toa third line, in other words: the user can't see the total
label of some products.

What can I do to make flash embed the fonts I want?

Thanks a lot.

createTextField("paintingLabel_txt",10,53,380,160,44);
with(paintingLabel_txt){
background = false;
html = true;
multiline = false;
selectable = false;
type = "dynamic";
wordWrap = true;
restrict = null;
embedFonts = false;
}
var labelStyle:TextFormat = new TextFormat();
with(labelStyle){
font = "Univers LightUltraCondensed";
size = 15;
color = 0x989289;
}
paintingLabel_txt.setNewTextFormat(labelStyle);
MikeMedia2
5/14/2006 7:26:52 PM
I'm no good at actionscript, but there is a way to embed fonts via the
interface.

Select your Dynamic text field.
On the title bar of your Library panel, click the right side graphic
Select New Font
Then fill in the blanks of the dialog box

If this is of any help, could you help me? (see: Just a litte syntax help)
Peter Blumenthal
5/15/2006 12:00:00 AM
[quoted text, click to view]

No - the OP states they are creating the text field *dynamically*.

Gleik - this line of code:

embedFonts = false;

Should be:

embedFonts = true;

You will also need to assign the font to the textfield. To do this you need
to insert a font in your library ('New font' from the drop down list top
right of library panel), and set the 'font' property of your TextFormat
object to the name you give the font.

HTH

P

--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------



aniebel
5/15/2006 12:00:00 AM
gleik, if what Peter recommended does not work still, try saving the text file
encoding as UTF-8. I ran into the same problem awhile back and I don't know if
it's a glitch or not but it only started working properly once I saved the file
that way. I had done everything else correctly except that.

Another way I've "cheated" in the past to ensure that my problem has not been
with embedding a dynamic text field was to type out all the characters of the
alphabet in a static text field, position it off stage and embed that. This way
you can try to figure out the problem may be occurring. It's kind of a clumsy
way of doing it but it's a temporary and sure way to know that your characters
will be there.
AddThis Social Bookmark Button