Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textarea Component

Status
Not open for further replies.

richiemartin

Technical User
Oct 9, 2003
12
GB
Hi,
I am using the TextArea component (MX2004). I have set the html setting to true and have entered my text. However, despite numerous attempts with different bits of code, I can’t get the font to be veranda, 10pt and red. I thought this would be a straightforward process. Does anyone have any suggestions?
Thank you for you time and help
rich
 
Rich,

You should try to get the text from an external txt file. There you specify the HTML tags.
When you load the text it will appear as regular text with the style that you defined in HTML.

Hope this helps,

greetz,
d2c
 
thats a great shout. i hadnt thought of that option.
thanks
rich
 
Everything here works. This is for a textArea on the _root timeline with the instance name "myText". Place the following on the main timeline "actions" layer (not on the component)

Code:
var styles = new TextField.StyleSheet();
styles.setStyle("body", 
  {fontFamily: 'Verdana', 
   fontSize: '10pt',
   fontStyle: 'italic',
   color: '#ff0000'}
);

	

myText.styleSheet = styles;
myText.html = true;
myText.text = "<body>This is my sample Text</body>";

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
I was missing the "Body" part of the code. probably why wast working before. Fantastic, I now have the choice of which option to use. Thank you for all your help
rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top