2 Replies Latest reply on Jul 28, 2010 1:26 AM by hidarikani

    Spark skinning fade in

    hidarikani Level 2

      I want my custom component to fade in

      when it's added to a container

      but the state desn't change when the component is created so I can't use a transition.

      What can I do?

        • 1. Re: Spark skinning fade in
          David_F57 Level 5

          hi,

           

          Use the show event to fire your state change. then you get your transition  .

           

          David

          1 person found this helpful
          • 2. Re: Spark skinning fade in
            hidarikani Level 2

            Inside my custom Spark component:

             

                      public function Node() { //constructor
                           super();
            
                           addEventListener(FlexEvent.SHOW, visibilityHandler);
                           addEventListener(FlexEvent.HIDE, visibilityHandler);
                      }
                      
                      protected function visibilityHandler(event:FlexEvent):void {
                           invalidateSkinState(); //this line is never executed
                      }
            
                      override protected function getCurrentSkinState():String {
                           var skinState:String = 'invisible';
                           
                           if (visible)
                                skinState = 'up';
                           
                           return skinState;
                      }
            

             

            visibilityHandler is never executed, so my skin state doesn't change but in Flex documentation:

            "After the last render event occurs, Flex performs the following actions: Makes the component visible by setting the visible property to true(...)"