View Full Version : textarea component troubles...

10-16-2005, 12:48 PM
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();
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
// Start a new function to load the text file
loadtextContent.onLoad = function(success) {
if (success) {
// loads the file into mytextbox
mytextbox.text = this.mytext;

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 += "";

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.