6 Replies Latest reply on Oct 10, 2011 9:58 PM by asdf;ldsrrgkldjrgklndf,.m

    Prevent View animation

    Francisc Level 3



      I'm not setting firstView in the ViewNavigatorApplication top declaration, instead I'm setting it based on some if-s in the creationComplete handler.


      1. How can I make it so that when I pushView there is no animation, as if firstView was set.

      I just want this for the first view, not throughout the entire application.


      2. Also, is there a way to keep showing the splash image until the first view is pushed?


      Thank you.

        • 1. Re: Prevent View animation
          Francisc Level 3


          • 2. Re: Prevent View animation
            kraikit Level 2

            I'm looking into whether we have a more officially supported way to do what you're looking for, but for now you could try the following:


                            var transition:CrossFadeViewTransition = new CrossFadeViewTransition();

                            transition.duration = 0;

                            navigator.pushView(MyNewView, null, null, transition);


            The CrossFadeViewTransition with a duration of 0ms is essentially the equivalent of a no-animation view change.


            -- Tom Kraikit

            Flex SDK engineer

            • 3. Re: Prevent View animation
              Francisc Level 3

              Thank you, Tom.

              • 4. Re: Prevent View animation

                There isn't an official way of doing this.  You have a couple of options though:


                1) Use a transition with a duration of 0

                2) Set transitionsEnabled to false on the navigator and reenable them after the transition is complete

                3) Change the defaultPushTransition property on your navigator to null, and either manually pass transitions to pushView or reset it after the view is added


                Let me know if that works out for you.  On a related note, if we provided a official api to do this, what would you expect it to look like?  Would it be a special transition?  A flag on pushView? A property on ViewNavigator? A cancelable event? Or something completely different?




                • 5. Re: Prevent View animation
                  Francisc Level 3

                  Hi Chiedo,


                  Thank you for your reply.


                  Regarding your enquiry, I think simple is best. By that I mean that simply passing null in the pushView method instead of specifying an instance of a view transition class.


                  If that's no good in terms of backwards compatibility, either a new Class (or constant e.g. ViewTransitionBase.NO_TRANSITION) to be the argument for the transition parameter or maybe a new method (e.g. pushViewNoTransition()) which also works without breaking backwards compatibility.


                  Hope this helps.

                  • 6. Re: Prevent View animation

                    i think if we add this


                         if(this.navigator.transitionsEnabled == false)


                                                                      this.navigator.transitionsEnabled = true;



                    in the Adobe Source Code is best.


                    So that we can add "this.navigator.transitionsEnabled = false;" it only can work in its filed but also it can't work in the whole code.