Help replacing the startDrag function

Hi there,

Currently working with the fake 3D possibilities of FP10 I found myself stuck with a xml text scroller than doesnt work anymore while being rotated in 3D.
The problem is the startDrag function (i’m almost sure of it but can be wrong), to me because of the bitmap conversion…so I rewrited the function with mouse functions and y positions to replace the drag function.

BUT I’m not sure I did a top job while creating the tests (if the content text reached its bottom end or is not yet scrolled), and so on…in my mind there are possibilities to make better.

My problem is when my scrollThumb = 0 or reaches the height end, how can I stop it without being obliged to test it < 0 or > total height ??

Here is what I had so far :


function scrollNow(e:Event):void {
    dragBtn.y = dragBtn.parent.mouseY + difY;
    dragger.y = dragBtn.parent.mouseY + difY;

    var target:Number = _mask.y + dragBtn.y * (_mask.height - scrollContent.height) /(_mask.height - dragBtn.height);
    Tweener.addTween(scrollContent, {y:target, time:0.75, transition:"EaseOut"});
    
    // test if my scroll button reaches the total height of the content mask
    if (dragBtn.y > scrollableHeight) {
        Tweener.addTween(scrollContent, {y: -scrollContent.height+_mask.height, time:0.75, transition:"EaseOut"});
        dragger.y = scrollableHeight;
        dragBtn.y = scrollableHeight;
    }
    
    // test if my scroll button came back on top and stop it going upper
    else if (dragBtn.y < 0) {
        Tweener.addTween(scrollContent, {y:0, time:0.75, transition:"EaseOut"}); 
        dragger.y = 0;
        dragBtn.y = 0;
    }
}


Any help would be really appreciated.

Thank you