1 Reply Latest reply on Nov 16, 2010 10:14 AM by Flex harUI

    updateDisplayList doesn't work for skin when called from hostcomponent

    jazterix

      I have skin class where I have overrided updateDisplayList like this:

       

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {

           switch (hostComponent.index) {
                  case 0:
                    part.right = 100;
                    part.top = 100;
                    break;
                  case 1:
                    part.right = 50;
                    part.top = 50;
                    break;

                  ...

      }

       

      every time I update index in hostcomponent, I want to call the updateDisplayList in skin so I have done this:

       

      public function set index(value:int):void {
              _index = value;
              invalidateDisplayList(); // doesn't work

              //updateDisplayList(); // doesn't work either      
      }

       

      ... but this does not work. Can you please help me figure out what the problem is? Thanks.