1 Reply Latest reply on Aug 6, 2010 6:31 AM by -BoNzO-

    save SkinPartEvent

    -BoNzO- Level 2

      Hi,

       

      The doc of this class mentions that the implementation of SkinnableComponent could change and we shouldn't rely on SkinPartEvent ( a bit like mx_internal then... ).

       

      Although, I found myself pretty much forced to use it and I think it would be nice if this event was standard and is retained in the future.

       

      As an example, see my use case :


      I need to automatically scroll the vertical scrollbar of a TextArea.

       

      For info, this was pretty much a one liner in Flex3, since the scrollbars were owned by the component itself ( I'm not saying this was better ). In Flex4, I have no problem writing a bit more code for such custom code providing there are sufficient hooks in the framework. ( I noticed the amount of bindable properties and dispatched events is maybe a bit lower than before which could makes things difficult )

       

      So the code I wrote basically does the following :

       

      _ Listen for SkinPartEvent.PART_ADDED and check if the part is the scroller

      _ add a PropertyChangeEvent.PROPERTY_CHANGE listener on the Scroller's IViewport with a low priority so that the scrollbar can update their maximum. I'm only interested in the "contentHeight" property.

      _ set the scroller.verticalScrollBar value to its maximum.

       

       

      Quite a few steps indeed. But regardless, I'm a bit afraid of the possibility that the hook I used ( SkinPartEvent ) might be removed ?