5 Replies Latest reply on Dec 1, 2008 3:35 PM by rtalton

    Choppy Transitions

      http://screencasts.bigbangtechnology.com/Choppiness.mov is a video of the problem
      http://pastie.org/328101 is a link to all the transition code

      The first time I transition to a component it is all choppy loading, I think because it is instancing the component. I tried putting creationPolicy="all" on the <mx:AddChild> but It doesn't make a difference... i just want to preload the component before doing the transition animation... any advice would be appreciated!
        • 1. Re: Choppy Transitions
          rtalton Level 4
          You know, it's actually not bad considering how much you have going on. It does seem like the creationPolicy should help, but there is so much going on at that moment with the layout and effects.

          Have you tried setting the suspendBackgroundProcessing property to TRUE on each of the effects? This blocks all of the layout and measuring going on in the app.
          • 2. Re: Choppy Transitions
            camwest Level 1
            Rtalton I'll try that.

            I don't think creationPolicy is working correctly. When I put creationComplete="trace('init')" on any of the components that I'm adding, I don't see any output in the console when the application loads. I should see this event dispatch if creationPolicy is set to "all"?

            I'll let you know about the suspendBackgroundProcessing property.
            • 3. Re: Choppy Transitions
              rtalton Level 4
              Adding the creationPolicy=all to the addChild tag may not help you much and may even slow you down if there multiple views in a child view stack, for instance. It would all have to be created during the transition.
              You should see that trace whenever the component is created. It may not be when the app loads, but when you switch to the state containing the child you are adding. Check it then.
              I think in your case, the creation policy on the component only kicks in when you change to the state containing that component, NOT when the app first loads.
              • 4. Re: Choppy Transitions
                camwest Level 1
                you are correct in your assertion rtalton, however I was under the impression that adding creationPolicy="all" to an mx:AddChild tag would instance the component regardless of state as long as the component that containted the <mx:states> tag was instanced.
                • 5. Re: Choppy Transitions
                  rtalton Level 4
                  Setting creationPolicy="all" on the addChild tag in your state definition shouldn't have any effect until you move to that state.

                  You could still set this to "all" on a navigator container within the state, and get the result you want.

                  If the component you are adding was made using MXML, you can set it's creationPolicy to "none", and then in code, use createComponentFromDescriptor() to instantiate it (only works on MXML components). I've used this and it works well.