PDA

View Full Version : textarea component troubles...


jbricker
10-16-2005, 12:48 PM
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();
------

Nucleus
10-16-2005, 02:48 PM
Seems like textarea is buggy.

Try this (or you can switch to textfield):
if (success) {
// loads the file into mytextbox
mytextbox.text = this.mytext;
mytextbox.text += "";
}

b3n
10-17-2005, 12:45 PM
Shouldn't it be:

mytextbox.htmlText = this.mytext;


Although if you're using an embedded font you have to have to set html to false, or the text wont show up.