Reputation: 11897
I think I've just spotted an apparent bug in flex 4.5.
The link to the relevant application is here. VIEW SOURCE ENABLED!!
These are the transitions:
<s:states>
<s:State name="State1"/>
<s:State name="State2"/>
<s:State name="State3"/>
</s:states>
<s:transitions>
<s:Transition fromState="State1" toState="State2" autoReverse="true" >
<s:Sequence>
<s:Move duration="500" target="{goButton}"/>
<s:AddAction targets="{[tagsLabel,tagsTextInput]}"/>
<s:Fade targets="{[tagsLabel,tagsTextInput]}" duration="500" />
</s:Sequence>
</s:Transition>
<s:Transition fromState="State1" toState="State3" >
<s:Sequence>
<s:RemoveAction targets="{[searchLabel,searchTextInput,inLabel,inDropDownList]}" />
<s:Move duration="500" target="{goButton}" />
<s:AddAction target="{lessonsDataGrid}" />
</s:Sequence>
</s:Transition>
<s:Transition fromState="State2" toState="State3" >
<s:Sequence>
<s:RemoveAction targets="{[searchLabel,searchTextInput,inLabel,inDropDownList,tagsLabel,tagsTextInput]}" />
<s:Move duration="500" target="{goButton}" />
<s:AddAction target="{lessonsDataGrid}" />
</s:Sequence>
</s:Transition>
<s:Transition fromState="State3" toState="State1" >
<s:Sequence>
<s:RemoveAction target="{lessonsDataGrid}" />
<s:Move target="{goButton}" duration="500" />
<s:AddAction targets="{[searchLabel,searchTextInput,inLabel,inDropDownList]}" />
</s:Sequence>
</s:Transition>
</s:transitions>
You see I'm working a little bit with Transitions here; one transition gets activated on the DropDownList
indexChangeEvent
and another is triggered by the clickEvent
on the magnifier Button
.
The problem I'm facing is as follows:
If I click the 'magnifier' Button
three times,(not 3 times in quick succession, but 1 click, wait for the transition, another click, wait for the transition, last click) then I get some funny behaviour: the magnifier Button
vanishes, even though I've never made it disappear in the transitions; and the TextInput
which was supposed to disappear didn't; it somehow got stuck in State3
which is the state with the Datagrid
in it.
Trust me, I've spent at least 4 hours on this writing and rewriting those transitions, I tried all sorts of things on the web but to no avail.
Hope someone can help, I'd hate to have to accept that Flex has got a bug. I'd be relieved to know it was something I did wrong and that Flex is still reliable.
Many thanks.
Upvotes: 1
Views: 189
Reputation: 704
I've played around with it for a while. Noticed that by some reason when changing the states, one of the AddItems overrides removes the element with index 0 from the Border container (you can debug and see for yourself if you add a handler for the removedFromStage event to the goButton). I'm still investigating the problem but i have a quick fix for you. Just include the goButton in all three states: includeIn="State1,State2,State3" and it won't disappear :] If I find the reason i'll post it to you.
Hope that helps,
Blaze
Upvotes: 2