TextArea.text 値が設定されていないか、設定されたままです。これは、トランジションがあり、Rotate3D を使用し、2 つのトランジションがある場合に発生します。1回のトランジションで動作します。2 つのトランジション (リターン トランジション) では、そうではありません。したがって、以下のケースでは、「メモ」から「リスト」への移行があります。「リスト」から「メモ」への遷移を追加すると、動作が発生します。しかし、textArea (メモ) を両方の状態にすると、正しく機能します (つまり、incluedIn="note,list" が機能します)。
<s:Group id="noteGroup" includeIn="note">
<s:TextArea id="normalTextArea" />
</s:Group>
<s:transitions>
<s:Transition fromState="note" toState="list"
autoReverse="false">
<s:Sequence target="{this}"
duration="{duration}" >
<s:Rotate3D angleYFrom="0" angleYTo="90"
autoCenterTransform="true"
applyChangesPostLayout="true"
/>
<s:SetAction target="{noteGroup}" property="visible" />
<s:RemoveAction target="{noteGroup}" />
<s:AddAction target="{listGroup}"/>
<s:Rotate3D angleYFrom="-90" angleYTo="0"
autoCenterTransform="true"
applyChangesPostLayout="true"/>
</s:Sequence>
</s:Transition>
<s:Transition fromState="list" toState="note"
autoReverse="false"
>
<s:Sequence target="{this}" duration="{duration}" >
<s:Rotate3D angleYFrom="0" angleYTo="-90"
effectStart="trace('rotateStart')"
duration="250"
autoCenterTransform="true"
applyChangesPostLayout="true" />
<s:AddAction target="{noteGroup}"
effectStart="trace('add notes action')"/>
<s:SetAction target="{noteGroup}" property="visible" />
<s:RemoveAction target="{listGroup}"
effectStart="trace('remove lists action')"/>
<s:Rotate3D angleYFrom="90" angleYTo="0"
effectStart="trace('rotateStart 2')"
duration="250"
autoCenterTransform="true"
applyChangesPostLayout="true" />
</s:Sequence>
</s:Transition>
</s:transitions>
~~更新~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
私が言及した回避策は、テキストエリアを両方の状態に含め、最初に含まれていなかった状態で表示を false に設定することです。
<s:Group id="noteGroup"
includeIn="note,list"
visible.list="false">
<s:TextArea id="normalTextArea" />
</s:Group>
~~更新~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
遷移後(Transitionの後)機能(FlexTrasに感謝)が表示されますが、テキストにカーソルを配置するまでテキストは表示されません。
リスト変更ハンドラー コード:
protected function list1_changeHandler(event:IndexChangeEvent):void {
content = (list.selectedItem as Note).content;
currentState = "note";
setTimeout(setText,1000);
}
private function setText():void {
normalTextArea.text = content; // works but only on clicking into the textarea
}
これは動作しません:
protected function list1_changeHandler(event:IndexChangeEvent):void {
content = (list.selectedItem as Note).content;
normalTextArea.text = content;
trace('1 text ='+normalTextArea.text); // contains content
currentState = "note";
normalTextArea.text = content;
trace('2 text ='+normalTextArea.text); // contains content
setTimeout(setText,1000);
}
// scenario 1
private function setText():void {
normalTextArea.text = content; // clicking into textarea it is empty
}
// scenario 2
private function setText():void {
normalTextArea.text = ""; // this does work but
normalTextArea.text = content; // you have to click into textarea
}