views:

187

answers:

4

Hello everyone,

the first time I change from state A to B it doesn't play the transition. After the first transition, the same state change does play the transition.

Before I let state B load, it parses an xml file and maps it to objects. When this is done, the state changes. Maybe it has to do with the parsing of the xml. But I can confirm that parsing is done, before it changes the state.

<s:Transition toState="B">
    <s:Sequence>
         <s:Move target="{menu}" duration="300" />
         <s:AddAction target="{newsPostsList}" />
         <s:Fade target="{newsPostsList}" />
    </s:Sequence>
</s:Transition>
A: 

Try to disable the XML parsing to be sure that isn't the problem. You could also explicitly specify the from state of your transition (either state "A" or state "*" for any state). Also try to add explicit x and y values for your Move action, just for sanity. It could be that the x and y positions of your menu component between states A and B aren't different.

swidnikk
I disabled the xml parsing and I can confirm that it plays it right after that. I have another state in my app that parses xml data the same way, but plays its transition right. I wrapped the parser up in a task extension and I'm sure the complete function is called after the parsing finished. I'm clueless here...
Marian André
I forgot to add that I'm using parsley as a framework. I just found out that when I remove the injected newsPosts from the parser, the transition runs again. I wonder what the problem could be. Maybe it has to do with parsley's injection.
Marian André
A: 

I have the same problem. I use "Fade" and "Crossfade" in the transitions, and those do not work for the first time, but work perfectly afterward. I am afraid I am too lazy to narrow down my issue to a working example - it's just too complex. However, I have ViewStack controlled by TabBar in my application and the state transitions include appearance of some of their children. There is no XML parsing in my case though :)

I hope this is not related to SDK-13933 bug (http://bugs.adobe.com/jira/browse/SDK-13993).

Green
A: 

It turned out that I had to get rid of "includeIn=myState" and replace those with "visible.myState=true" and "includeInLayout.myState=true". It made the transitions run every time.

Green
A: 

I found the source of evil :) Turns out I fired the state change a little before the parsed data was available to the model.

Thanks to everyone for helping me out on this. I've had problems with transitions not firing the first time already before. Your answers will be a resource to check for common mistakes.

Marian André