I’m trying to load text from a text file into a dynamic text box that’s inside a ScrollPane component. If the text in the file exceeds the size of the dynamic text box, the text box doesn’t change it’s height automatically, so I’m trying to do that dynamically. This is the code I have right now.
events.html=true;
eventsLoadVar = new LoadVars ();
eventsLoadVar.load(“documents/events.txt”);
eventsLoadVar.onLoad = function (success){
if (success == true) {
events._height=eventsLoadVar.eventsheight;
events.htmlText=eventsLoadVar.eventstext;
}
}
It seems to be working properly, but not on the first time the page loads. I have to refresh the page for the height to actually take effect.
Does anyone know how I can get the height to change on the first load, or is there a better way to be doing all of this?