Textfield.stylesheet.onload - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

TextField.StyleSheet.onLoad

Availability
Flash Player 7.
Usage
styleSheet.onLoad = function (success:Boolean) {}
Parameters
A Boolean value indicating whether the CSS file was successfully loaded.
success
Returns
Nothing.
Description
Callback handler; invoked when a
style sheet loaded successfully, the
or if an error occurred in receiving the response from the server, the
Example
The following example loads the CSS file named styles.css into the style sheet object
When the file has finished loading successfully, the style sheet object is applied to a TextField
object named
news_txt
this.createTextField("news_txt", 999, 10, 10, 320, 240);
news_txt.multiline = true;
news_txt.wordWrap = true;
news_txt.html = true;
var my_styleSheet:TextField.StyleSheet = new TextField.StyleSheet();
my_styleSheet.onLoad = function(success:Boolean) {
if (success) {
news_txt.styleSheet = my_styleSheet;
news_txt.htmlText = "<p class=\"heading\">Heading goes here!</p><p
class=\"mainBody\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.</p>";
}
};
my_styleSheet.load("styles.css");
For the code contained in styles.css, see the entry for TextField.StyleSheet.getStyle(). For an
example of asynchronously loading style sheets using ActionScript 2.0, see the entry for
TextField.StyleSheet.getStyle().
See also
TextField.StyleSheet.load()
TextField.StyleSheet.load()
parameter is
success
.
operation has completed. If the
. If the document was not received,
true
parameter is
success
TextField.StyleSheet.onLoad
.
false
.
styleObj
865

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents