Wenn "\ n" nicht für Sie funktioniert, versuchen Sie "\ r" (Wagenrücklauf). Hier einige Code demonstriert, wie es funktionieren würde - geben Sie einfach in die Box und Sie werden die Array-Inhalte sehen zu ändern:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete(event)">
<mx:Script>
<![CDATA[
import mx.events.CollectionEvent;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable]
private var ac:ArrayCollection;
protected function onCreationComplete(event:FlexEvent):void
{
ac = new ArrayCollection();
ac.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange);
}
protected function onKeyUp(event:KeyboardEvent):void
{
ac.source = event.target.text.split("\r");
}
protected function onCollectionChange(event:CollectionEvent):void
{
contents.text = ac.source.join("\r");
}
]]>
</mx:Script>
<mx:TextArea id="input" x="19" y="22" width="273" height="175" keyUp="onKeyUp(event)" />
<mx:TextArea id="contents" x="112" y="249" width="180" height="175" editable="false" />
<mx:Label x="19" y="222" text="Array Length:" fontWeight="bold" />
<mx:Label x="37" y="250" text="Contents:" fontWeight="bold" />
<mx:Label x="111" y="222" text="{ac.length}" />
</mx:Application>
Hoffe, es hilft!
vielen Dank !!! es ist genau das, was ich brauche! – simplemagik