Using UI Scrollbar to fit the text within the content area of the layout
For the info section of this website, the content is contained in an HTML file that loads dynamically when the site movie is played.I created a text box with dynamic, multiline properties and attached a scroll bar component or UIScrollbar. Placed the function (set of instructions) for loading a text file in the first frame of the main Timeline.
TextInfo.text and stylesSite.css are external files that this ActionScript is calling to load in the text box.
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("stylesSite.css");
cssStyles.onLoad = function (success) {
if (success) {
textInfo.styleSheet = cssStyles;
_root.myLoadVars.load("textInfo.txt");
} else {
textInfo.text = "An error occured loading the requested content.";
}
}
No comments:
Post a Comment