无论我做什么,我的转换都不会按预期工作。我将解释这些问题,然后将代码放在底部。
我的申请中有 4 个州。
goButton
仅存在于"State1"
和中"State2"
。
State1
和State2
几乎相同,但每个的y
属性goButton
不同。所以我做了一点过渡,使按钮来回移动。目前很好。
但是,两者 "State1"
和"State2"
也可以转换为"State3"
。但是没有goButton
in "State3"
,所以我使用了<s:Fade>
和<s:RemoveAction>
效果来摆脱它。
从 "State1"
to过渡可以正常"State3"
工作,但从to过渡不能。"State2"
"State3"
当我尝试调用从"State2"
到闪烁/闪烁"State3"
的过渡goButton
快速回到它所在的位置时"State1"
,只有过渡到"State3"
实际发生。
这是我的goButton
<s:Button id="goButton" includeIn="State1,State2" x="319" y="212" width="33" height="33"
click="goButton_clickHandler()"
icon="@Embed('file:///C:/Users/Felipe/Downloads/1317358341_magnifier_medium.png')"
toolTip="go"
x.State2="319" y.State2="275"/>
这些是相关的转换:
<s:Transition fromState="State1" toState="State3" >
<s:Sequence>
<s:Fade duration="700" targets="{[searchLabel,searchTextInput,inLabel,inDropDownList,goButton,addNewLessonButton]}" />
<s:RemoveAction targets="{[searchLabel,searchTextInput,inLabel,inDropDownList,goButton,addNewLessonButton]}" />
<s:AddAction targets="{[lessonsDataGrid,backButton]}" />
<s:Fade duration="700" targets="{[lessonsDataGrid,backButton]}" />
</s:Sequence>
</s:Transition>
<s:Transition fromState="State2" toState="State3" >
<s:Sequence>
<s:Fade duration="700" targets="{[searchLabel,searchTextInput,inLabel,inDropDownList,tagsLabel,tagsTextInput,goButton,addNewLessonButton]}" />
<s:RemoveAction targets="{[searchLabel,searchTextInput,inLabel,inDropDownList,tagsLabel,tagsTextInput,goButton,addNewLessonButton]}" />
<s:AddAction targets="{[lessonsDataGrid,backButton]}" />
<s:Fade duration="700" targets="{[lessonsDataGrid,backButton]}" />
</s:Sequence>
</s:Transition>
我的猜测是 Flex 总是(不要问我为什么)在执行转换之前将组件移回其原始位置。我尝试了这个应用程序的不同版本,在其中我将我的x
和y
属性设置goButton
为它们所在的位置"State2"
,然后设置x.State1 = something else
并y.State1 = something else
猜猜会发生什么?我得到了确切的反问题!从"State2"
to转换"State3"
是可以的,但是从"State1"
to转换"State3"
不起作用,因为goButton
闪烁回到其原始位置(现在它是 中的位置"State2"
),然后才会发生转换。
伙计,这让我发疯。 _ __ _ __ _ __ _ __ _ __ _ __ // _ __ _ __ _ __ _ __ _ __ _ _ _ __ _ __ _ __ _ __ __ _ __ _ __ _ __ _ __ _ __ _ // _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _
编辑
我添加了应用程序的链接 >>>> HERE <<<<<<您可以通过选择“选定标签”选项然后单击“goButton”来查看问题。你会看到我在说什么。查看源代码可用!!!