Scroll with Actionscript

Author: Digicrafts Last Update: 01/01/1970

On progress....

1. Setup a TouchScroller.

Following the guide here to setup a working scrol.

Quick Start Guide

 

 2. Add control button.

Create or insert button on the stage.

Name the button with instance name.

 

 3. Add Action Script
 
 // Action to scroll by actionscript

function handleScrollButton(e:MouseEvent){
    switch(e.target.name){
        case "scrollTop":
            scroller.scrollToTop();
            break;
        case "scrollBottom":
            scroller.scrollToBottom();        
            break;
        case "scrollLeft":
            scroller.scrollToLeft();        
            break;
        case "scrollRight":
            scroller.scrollToRight();        
            break;
    }
}
scrollTop.addEventListener(MouseEvent.CLICK,handleScrollButton);
scrollBottom.addEventListener(MouseEvent.CLICK,handleScrollButton);
scrollLeft.addEventListener(MouseEvent.CLICK,handleScrollButton);
scrollRight.addEventListener(MouseEvent.CLICK,handleScrollButton);