createTextField, external text load and scrollbar ui - my code??
I know I'm doing something wrong when trying to load the text through a variable. Any thoughts???
> Not loading external text works fine for me:
(a little clunky, but it's a working first step)
Only things in my fla file are this code and a UIScrollBar I dragged to my library to link to.
Code:
this.createTextField('myTextField',1,0,0,80,80);
type = "dynamic";
myTextField.multiline = true;
myTextField.wordWrap = true;
myTextField.text = 'i have lots of lorum ipsum here....';
initialization={_targetInstanceName:'myTextField',horizontal:false};
_root.attachMovie('UIScrollBar','myScrollbar',2,initialization);
> When I load the text through the variable, it DOESN'T work:
Code:
this.createTextField('myTextField',1,0,0,80,80);
type = "dynamic";
myTextField.multiline = true;
myTextField.wordWrap = true;
function textLoader() {
myData = new LoadVars();
myData.onLoad = function() {
myTextField.html = true;
myTextField.htmlText = this.myVariable;
};
myTextField.myData.load("text/content_03_01.txt");
}
var myCSS = new TextField.StyleSheet();
myCSS.load("text/style_sheet.css");
myCSS.onLoad = function() {
myTextField.styleSheet = myCSS;
textLoader();
};
initialization={_targetInstanceName:'myTextField',horizontal:false};
_root.attachMovie('UIScrollBar','myScrollbar',2,initialization);