Groups | Blog | Home
all groups > flash (macromedia) > september 2004 >

flash (macromedia) : Textarea Component (Formatting Text)


Digitalosophy
9/7/2004 9:00:01 PM
Accoring to Ultrashock:

[code]
content0.backgroundColor = 0x5AADD2;
content0.borderStyle = "solid";
content0.borderColor = 0x5AADD2;
content0.fontFamily = "Verdana"; // doesnt work
content0.fontSize = "10"; // doesnt work
content0.fontWeight = "bold"; //doesnt work
[/code]

All of that should work. As you can see I can't set the fontFamily, fontSize,
and fontWeight of my text. The ones that aren't commented work fine, but I
can't find a good link or tutorial on this subject.

I thought Macromedia had something on this, can't seem to find it.

Thanks
Annie123
9/7/2004 11:40:49 PM
First, you have to create the text, then you have to create a format for that
text, finally you have to apply the format to the text:



// Create header
this.createTextField ("head_txt", 3, 32, 135, 550, 30);
head_txt.text = "Click the text below to find out more about what I do."
head_txt.selectable = false;


// Create header format
headFormat_fmt = new TextFormat();
with (headFormat_fmt) {
font = "optima";
bold = true;
italic = true;
size = 20;
color = 0xffffff;
}

// Apply text format to header
head_txt.setTextFormat(headFormat_fmt);
pwiop
9/8/2004 12:11:03 AM
You can also use an external css file and the following code

var myStyles = new TextField.StyleSheet();
//load the css information
ss.load("myStyles.css");
//apply the css to a texfiled
TextViewer.styleSheet = myStyles;

I use this quite a lot

p a u l
Digitalosophy
9/8/2004 2:36:47 AM
AddThis Social Bookmark Button