Instead of using the common method of using a mask to mask out the content area and shift the whole content area. This post show how we can implement a scrolling using scrollRect. The result will be the same, in fact it will be faster.
ScrollRect property allow us to scroll movie clip content quickly. Text fields and complex content scroll much faster as pixel level copying is used to scroll the data instead of regenerating the entire movie clip. To enhance the performace, use scrollRect together with cacheAsBitmap.
// set the scrollbar content width and height var sWidth:Number=350; var sHeight:Number=250;
// set allowance at the end of the scroll var allowance:Number=3;
// declare the scrollRect area using the Rectangle class var rect:Rectangle=new Rectangle(0,0,sWidth,sHeight);
// calculate the content height & add allowance to it var cHeight:Number=Math.ceil(content_mc._height)+allowance;
scroll_mc._height=Math.floor(sHeight/cHeight*sHeight); // set the scrollbar height
// bitmap caching for content_mc
content_mc.cacheAsBitmap=true;
var top:Number=0; var btm:Number=sHeight-scroll_mc._height;