The style sheet associated with a TextArea component may be changed at any time. If the style
sheet in use is changed, the TextArea component is redrawn with the new style sheet. The style
sheet may be set to
removed, the TextArea component is redrawn without a style sheet. The formatting done by a
style sheet is not retained if the style sheet is removed.
Example
The following code creates a new StyleSheet object named
TextField.StyleSheet
then uses
LoadVars.load
within
,
<html>
<body>
, the text within those tags is styled according to the StyleSheet object
MyTextArea
// create the new StyleSheet object
var styles = new TextField.StyleSheet();
// define styles for <html>, <body>, and <td>...
styles.setStyle("html",
{fontFamily: 'Arial,Helvetica,sans-serif',
fontSize: '12px',
color: '#0000FF'});
styles.setStyle("body",
{color: '#00CCFF',
textDecoration: 'underline'});
styles.setStyle("td",
{fontFamily: 'Arial,Helvetica,sans-serif',
fontSize: '24px',
color: '#006600'});
// set the TextAreaInstance.styleSheet property to the newly defined
// styleSheet object named styles
myTextArea.styleSheet=styles;
myTextArea.html=true;
// Load text to display and define onLoad handler
var myVars:LoadVars = new LoadVars();
myVars.load("myText.htm");
myVars.onData = function(content) {
_root.myTextArea.text = content;
};
TextArea.text
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
or
to remove the style sheet. If the style sheet in use is
null
undefined
constructor. It then defines styles for
to load an HTML file named myText.htm. That file contains text
and
tags. When the text is displayed in the TextArea instance
<td>
with the
styles
new
,
and
<html>
<body>
TextArea component
tags. It
<td>
.
styles
739
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers