1 Reply Latest reply on Nov 20, 2006 9:14 AM by clbeech

    Problem with TextArea and StyleSheet


      I've got a following problem - I have a TextArea element, that loads the text from XML file. Furthermore the elements reads css settings to format the text. Everything seems to be ok, but if I reload text in textarea the css-formatting fails, and I've already tried to do everything to avoid this, but whatever I do, the formatting breaks.
      As you see I have event listener for list component - if I click on list item the text should be loaded into textarea component (textarea1) and be formatted according to setStyle. But it only happens once, and second time the text is loaded but not formatted (althought in the first moment it appears to be formatted but then the formatting get broken).
        • 1. Re: Problem with TextArea and StyleSheet
          clbeech Level 3
          Hello, I'm not certain if the declarations are the same for a Textfield Component, and I also don't know if you have included the statement?

          import Textfield.StyleSheet;

          Also, after the setStyle declaration, I think you may need to assign the StyleSheet to the text field with something like ...

          textContent.styleSheet = textStyle;

          Careful with the case here on 'styleSheet', the assignment statement is different than the other useages of the 'StyleSheet' command.

          I'm also not sure that the prefixes are necessary in the var statement, they could be if useing a Component, but in my limited experience here I've had sucess with...

          var textStyle:StyleSheet = new StyleSheet();

          as opposed to ...

          var textStyle:TextField.StyleSheet = new TextField.StyleSheet();

          Just some thoughts.