1 Reply Latest reply on Nov 21, 2012 12:31 PM by Spacorum

    Mobile: Spark Fade effect not working on device

    Spacorum

      Hello:

       

      I have a TabbedViewNavigatorApplication with Flex 4.6 SDK that has four ViewNavigator (tabs). In the first one, its initial view has a Spark List with custom IconItemRenderer, and clicking on an item the navigator pushes another view. I applied a Spark Effect to make a fade-out on the current view before pushing the new one (on the EFFECT_END event).

       

      This is the effect definition:

       

      <fx:Declarations>

           <s:Fade duration="{ParamsModel.timeoutFadeOut}" id="fadeOutEffect" alphaFrom="1.0" alphaTo="0"/>

      </fx:Declarations>

       

       

      And this is the function launched when the user clicks on an item of the list:

       

      public function loadView(view:*, data:Object):void

      {

           // Avoid default slide transition between views

           tabbedNavigator.activeView.navigator.defaultPushTransition = null;

       

           // Add listener to detect the end of the fade-out effect

           fadeOutEffect.addEventListener(EffectEvent.EFFECT_END, function(event:EffectEvent):void

           {

                // Remove this listener until next "loadView()" call

                IEventDispatcher(event.currentTarget).removeEventListener(event.type, arguments.callee);

       

                // Once the fade is finished, push the new view

                tabbedNavigator.activeView.navigator.pushView( view, data);

           }

       

           // Play the fade effect on current active view

           fadeOutEffect.play([tabbedNavigator.activeView]);

      }

       

       

      In fact, this code runs smooth on the emulator, but I can´t see any fade effect on the device. I mean, it´s not that the effect runs buggy or slowly. It doesn´t fade at all. There´s a lapse of time (exactly the duration of the effect) where nothing happens, and then the new view loads without any effect. What I am missing?? I really miss some kind of "emulated hardware setup" on the emulator to certainly know if what I see on the computer will work (in terms of performance) on the device.. I easily spend 50% of the time coding and 50% fixing this kind of continuous performance problems.

       

      EDIT: In one of the tabs, a custom list has a gradient background. I don´t know why, but this background is the only element that seems to be affected by the Fade effect. It smoothly turns to alpha:0, but its containing items don´t.

       

       

      Thanks in advance!