Código ActionScript :
import fl.transitions.Tween; import fl.transitions.easing.*; var sd:Number; var sr:Number; var cd:Number; var cr:Number; var new_y:Number; var drag_area:Rectangle; var msb_content:MovieClip; var msb_content_area:MovieClip; var scrolling_speed:Number; // 0.00 to 1.00 function scrolling( ct:String, ct_area:String, speed:Number ):void { scrolling_speed = speed; if( scrolling_speed < 0 || scrolling_speed > 1 ) scrolling_speed = 0.50; msb_content = parent[ct]; msb_content_area = parent[ct_area]; msb_content.mask = msb_content_area; msb_content.x = msb_content_area.x; msb_content.y = msb_content_area.y; msb_scroller.x = msb_scrollable_area.x; msb_scroller.y = msb_scrollable_area.y; sr = msb_content_area.height / msb_content.height; msb_scroller.height = msb_scrollable_area.height * sr; sd = msb_scrollable_area.height - msb_scroller.height; cd = msb_content.height - msb_content_area.height; cr = cd / sd * 1.02; drag_area = new Rectangle(0, 0, 0, msb_scrollable_area.height - msb_scroller.height); if ( msb_content.height <= msb_content_area.height ) { msb_scroller.visible = msb_scrollable_area.visible = false; } msb_scroller.addEventListener( MouseEvent.MOUSE_DOWN, scroller_drag ); msb_scroller.addEventListener( MouseEvent.MOUSE_UP, scroller_drop ); msb_content.addEventListener(MouseEvent.MOUSE_WHEEL, on_wheel); this.addEventListener( Event.ENTER_FRAME, on_scroll ); } function scroller_drag( me:MouseEvent ):void { me.target.startDrag(false, drag_area); stage.addEventListener(MouseEvent.MOUSE_UP, up); } function scroller_drop( me:MouseEvent ):void { me.target.stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_UP, up); } function up( me:MouseEvent ):void { msb_scroller.stopDrag(); } function on_wheel(e:MouseEvent):void { if( e.delta > 0 ) { new Tween( msb_scroller, "", Strong.easeOut, msb_scroller.y, msb_scroller.y++, 0, true ); } else { new Tween( msb_scroller, "", Strong.easeOut, msb_scroller.y, msb_scroller.y--, 0, true ); } } function on_scroll( e:Event ):void { new_y = msb_content_area.y + msb_scrollable_area.y * cr - msb_scroller.y * cr; msb_content.y += ( new_y - msb_content.y ) * scrolling_speed; }