Wednesday, September 23, 2009

Add Style Sheet to Dynamic Text

sample css for dynamic text

.bodyCopy
{
font-family: Arial;
font-size: 12px;
color: #666666;
line-height: 28px;
}

ActionScript

var format = new TextField.StyleSheet();
var path = "main_styles.css";

format.load(path);
format.onLoad = function(success) {
if (success) {
output.styleSheet = format;
} else{
trace("style sheet not loaded")
}
}

No comments:

Post a Comment