jbricker
10-13-2005, 02:06 AM
Hi!
Any thoughts on the following:
I have a text area "mytextbox" sitting in a movieclip "news" which is in the main timeline.
I'm trying to populate the textarea with some dynamic html... and have used a script tutorial file that I found online to figure it all out....
works fine in the tutorial file (which has everything happen in the main timeline) but since I have it in a movieclip, it seems to fail.... any suggestions???
Here's the code I'm using:
-----------
// Load the CSS file and attach it to my mytextbox
mytextboxstyle = new TextField.StyleSheet();
mytextboxstyle.load("text_style.css");
mytextbox.styleSheet = mytextboxstyle;
// Specify mytextbox to read text as HTML
mytextbox.html = true;
// Specify mytextbox to wrap text
mytextbox.wordWrap = true;
// Specify mytextbox to have a scrollbar
mytextbox.multiline = true;
function populatebox() {
loadtextContent = new LoadVars();
// Load the text file into my movie
loadtextContent.load("text_content.txt");
// Start a new function to load the text file
loadtextContent.onLoad = function(success) {
if (success) {
// loads the file into mytextbox
mytextbox.text = this.mytext;
}
};
};
populatebox();
------
Any thoughts on the following:
I have a text area "mytextbox" sitting in a movieclip "news" which is in the main timeline.
I'm trying to populate the textarea with some dynamic html... and have used a script tutorial file that I found online to figure it all out....
works fine in the tutorial file (which has everything happen in the main timeline) but since I have it in a movieclip, it seems to fail.... any suggestions???
Here's the code I'm using:
-----------
// Load the CSS file and attach it to my mytextbox
mytextboxstyle = new TextField.StyleSheet();
mytextboxstyle.load("text_style.css");
mytextbox.styleSheet = mytextboxstyle;
// Specify mytextbox to read text as HTML
mytextbox.html = true;
// Specify mytextbox to wrap text
mytextbox.wordWrap = true;
// Specify mytextbox to have a scrollbar
mytextbox.multiline = true;
function populatebox() {
loadtextContent = new LoadVars();
// Load the text file into my movie
loadtextContent.load("text_content.txt");
// Start a new function to load the text file
loadtextContent.onLoad = function(success) {
if (success) {
// loads the file into mytextbox
mytextbox.text = this.mytext;
}
};
};
populatebox();
------