Apache flex 使用文本区域的appendText属性返回错误
我的主应用程序中有一个文本区域,如下所示:Apache flex 使用文本区域的appendText属性返回错误,apache-flex,flex4,Apache Flex,Flex4,我的主应用程序中有一个文本区域,如下所示: <s:TextArea id="textAreaLog" visible="false" height="100%" width="100%"/> 然后: mx.core.FlexGlobals.topLevelApplication.textAreaLog.text = "Testing...\n;" 上述代码工作正常,即字符串“Testing…”进入textAreaLog。但是在使用textArea的appendText属性时: i
<s:TextArea id="textAreaLog" visible="false" height="100%" width="100%"/>
然后:
mx.core.FlexGlobals.topLevelApplication.textAreaLog.text = "Testing...\n;"
上述代码工作正常,即字符串“Testing…”进入textAreaLog。但是在使用textArea的appendText属性时:
import mx.core.FlexGlobals;
mx.core.FlexGlobals.topLevelApplication.textAreaLog.appendText = "Testing...\n;"
出现以下错误:
Error #1037: Cannot assign to a method appendText on spark.components.TextArea.
如果使用而不是where,则会发生相同的错误
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
任何关于如何解决这个问题的想法。我可以通过下面的命令追加文本,这似乎不是一个好的选择,或者是吗?如果文本区域中的文本大小大幅增加,是否会导致代码行无效
mx.core.FlexGlobals.topLevelApplication.textAreaLog.text += "Testing...\n;"
试试这个:
mx.core.FlexGlobals.topLevelApplication.textAreaLog.appendText("your text");
有关appendText()
方法的更多信息:
()
祝你好运,
抢劫