Saturday, November 17, 2012

Flex 4.5: Customize Scrollbars

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
  xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="absolute"
  creationComplete="onCreationComplete()" viewSourceURL="srcview/index.html">
 
  <mx:Style>
    ScrollBar
    {
      track-skin: Embed(source='assets/track.png',
              scaleGridLeft="2", scaleGridTop="6",
              scaleGridRight="7", scaleGridBottom="9");
      up-arrow-skin: ClassReference("undefined");
      down-arrow-skin: ClassReference("undefined");
    }
   
  </mx:Style>
 
  <mx:Script>
    <![CDATA[
      import mx.utils.UIDUtil;
      import mx.collections.ArrayCollection;
     
      [Bindable]
      private var ac : ArrayCollection;
     
      private function onCreationComplete() : void
      {
        ac = new ArrayCollection();
       
        for (var i:int = 0; i < 25; i ++)
        {
          ac.addItem( UIDUtil.createUID() );
        }
      }
    ]]>
  </mx:Script>
 
  <mx:List width="100%" height="100%"
    dataProvider="{ ac }" />
 
</mx:Application>

No comments:

Post a Comment