Onload (Stylesheet.onload Handler) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
-
if no parameter (
Boolean
false
handler to check the success of a loaded StyleSheet.
Example
For an example of asynchronously loading style sheets using ActionScript 2.0, see the example
for
.
getStyle()
The following example loads the CSS file named styles.css into the StyleSheet object
. When the file has loaded successfully, the StyleSheet object is applied to a
my_styleSheet
TextField object named
import TextField.StyleSheet;
this.createTextField("news_txt", 999, 10, 10, 320, 240);
news_txt.multiline = true;
news_txt.wordWrap = true;
news_txt.html = true;
var my_styleSheet:StyleSheet = new 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 complete code for styles.css, see the example for
See also

onLoad (StyleSheet.onLoad handler)

onLoad (StyleSheet.onLoad handler)
onLoad = function(success:Boolean) {}
Invoked when a
load()
parameter is
success
receiving the response from the server, the
Availability: ActionScript 1.0; Flash Player 7
) is passed;
null
.
news_txt
,
operation has completed. If the StyleSheet loaded successfully, the
. If the document was not received, or if an error occurred in
true
otherwise. Use the
true
getStyle()
getStyle (StyleSheet.getStyle method)
parameter is
success
StyleSheet (TextField.StyleSheet)
callback
onLoad()
.
.
false
1149

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF