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

flash actionscript : how do I control size and font if a dynamic text?



Wolf van Ween
4/30/2006 7:14:47 PM
Created dynamically or "by hand"? If the latter, in the property panel.
aa
4/30/2006 9:53:52 PM
how do I control size and font if a dynamic text?

aa
4/30/2006 11:55:52 PM
It is created by hand, but I have several instances thereof and need to set
different sizes for different instances

[quoted text, click to view]
help file.

Wolf van Ween
5/1/2006 12:00:00 AM
Not entirely clear to me, where your problem originates.
Each dynamic text field is an instance of the TextField class, and all the
things you set in the property panel are for this one instance only. You can't
have more than one instance of the same text field, like you can have more than
one instance of a movieClip. Text Fields are not library symbols.
So what exactly do you mean when you say "I have several instances thereof",
do you mean you duplicated or copy-pasted a text field? If so, just go ahead
and change size in the property panel separately for each of these copies.
aa
5/1/2006 12:00:00 AM
Sorry for being vague.
I have a library movie clip which contains a manually created text field

Then with attachMovie I have several instances of the movieClip and wanted
to set font size for textfield in each instance

[quoted text, click to view]

skullnz
5/1/2006 2:13:13 PM
This isn't the best example, but I hope it helps: (mycontent is the dynamic
text field)

mycontent.html = true;
var myformat = new TextFormat ();
myformat.font = "Arial";
myformat.size = 11;
mycontent.htmlText = thecontent;
mycontent.setTextFormat(myformat);

I was told the order of the above was vital. You must set the content THEN set
the format.

Also, don't use Arial. I've since found that using virtually any
non-device/non-default font will work out better.
aa
5/1/2006 8:01:15 PM
Thanks

AddThis Social Bookmark Button