-
Senior Member
making text bold in textfield
I want to make an imported text from a textfile be bold.
How do I do it?
This is what it looks like now:
this.createTextField("my_txt", 10, 10, 10, 80, 100);
my_txt.setNewTextFormat(new TextFormat("Arial",12,0xCC6600));
boldFormat = new TextFormat();
boldFormat.bold = true;
my_text.setTextFormat(0,99,boldFormat);
my_txt.autoSize = "left";
my_txt.border = false;
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt._height = 100;
var lorem_lv:LoadVars = new LoadVars();
lorem_lv.onData = function (src:String):Void {
if (src != undefined) {
my_txt.text = src;
} else {
my_txt.text = "Unable to load external file.";
}
}
lorem_lv.load("upload/flash/start_files/skylt1.txt");
Mattias Gordon
illustrator/ animator
-
I think you have to use the setTextFormat command after the text has been loaded, but I'm not 100% sure.
Maybe try it like this:
Code:
if (src != undefined) {
my_txt.text = src;
my_txt.setTextFormat(boldFormat);
} else {
my_txt.text = "Unable to load external file.";
my_txt.setTextFormat(boldFormat);
}
-
Senior Member
I could not make it work. I put it after and the way you did above put it did not work.
Mattias Gordon
illustrator/ animator
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|