I have a textArea in my main application as:
<s:TextArea id="textAreaLog" visible="false" height="100%" width="100%"/>
I have another mxml file in which I access that textArea as:
import mx.core.FlexGlobals;
and then:
mx.core.FlexGlobals.topLevelApplication.textAreaLog.text = "Testing...\n;"
Above code works fine i.e. the string “Testing…” gets into the textAreaLog. But upon using appendText property of textArea as:
mx.core.FlexGlobals.topLevelApplication.textAreaLog.appendText = "Testing...\n;"
following error arises:
Error #1037: Cannot assign to a method appendText on spark.components.TextArea.
Same error occurs if I use instead of where,
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
Any idea of how to resolve this problem. I am able to append text via following command which does not seem a good option or is it? Won’t following line of code by inefficient if size of text in the Text Area increases considerably?
mx.core.FlexGlobals.topLevelApplication.textAreaLog.text += "Testing...\n;"
try this:
More information about the
appendText()method:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/supportClasses/SkinnableTextBase.html#appendText()
Good luck,
Rob