I copied that into a test fla and all works fine for me...
is your css valid? Heres some simple test rules:
p {
color: #000000;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
display: inline;
}
a:link {
color: #FF00FF;
text-decoration: underline;
}
a:hover{
color: #999999;
text-decoration: none;
}
.headline {
color: #0000FF;
font-family: Arial,Helvetica,sans-serif;
font-size: 18px;
font-weight: bold;
display: block;
}
.byline {
color: #666600;
font-style: italic;
font-weight: bold;
display: inline;
}
Following examples from livedocs, help and a couple of tutorials, I've
tried to load a style sheet into my movie.
Nothing radical, the style sheet is named "styles.css" and is located
in the same directory as the .swf.
A new TextField.StyleSheet() object has been created. (Actually, all
of the code I just cut and pasted from MM's livedocs, changing a
couple of variable names. So I have the .load and .onLoad methods, yet
never success - always the "Styles failed to load" message.
Do I have to place styles.css on the web server alongside the scripts
which feed data to the movie and fetch it from there?
Suggestions and guidance, as always, will be welcome, code fragment is
below.
Thanks for looking at this - Miles Thompson
Here's the code, much of it will look familiar ...
var myCSS:TextField.StyleSheet = new TextField.StyleSheet();
var cssURL:String = "styles.css";
myCSS.onLoad = function(success:Boolean) {
if (success) {
trace("Styles loaded:");
var styles_array:Array = myCSS.getStyleNames();
trace(styles_array.join(newline));
txtNews.styleSheet = myCSS;
txtHead.styleSheet = myCSS;
} else {
trace("Styles failed to load.");
}
};
myCSS.load(cssURL);
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders