I am attempting to insert text from a database into a custom TextArea component, using the following:
var front:CaptionTextArea = myFlashcardFrontsides[adjIndex] as CaptionTextArea;
var back:CaptionTextArea = myFlashcardBacksides[adjIndex] as CaptionTextArea;
var passage:CaptionTextInput = myVersePassage开发者_StackOverflows[adjIndex] as CaptionTextInput;
front.text = passage.text;
back.text = str;
This works 100% of the time for smaller strings. However, if I insert long strings of text, the application will hang consistently. The maxchars
for the textarea is set to 1200, and the text that is inserted into the text area is always smaller than the character limit:
backside.maxChars = 1200;
How can this problem be fixed?
I resolved the issue, and all I had to do was change my TextArea from a Spark
TextArea to an MX
TextArea:
// import spark.components.TextArea; DON'T USE: SPARK TEXT AREA CAUSES A BUG WHEN PROGRAMATICALLY INSERTING LONGER TEXT STRINGS
import mx.controls.TextArea;
public class CaptionTextArea extends TextArea
It seems like there is an Adobe bug that causes my application to freeze when programatically inserting long strings of text into the newer text area.
I am facing this issue myself right now. I think the problem is, when you add a long text (so long that scrollbars appear) to a TextArea and its not yet on the stage, the error is thrown. I believe the component has problems adding the scrollbar to the container. mx:TextArea works, but its not good for styling the component, so it would be nice if apache (?) fixed that.
精彩评论