Ease Scroll...
January 6th, 2009up_arrow.onRelease = function() {
form.body_txt.scroll--;
};
down_arrow.onRelease = function() {
form.body_txt.scroll++;
};
...so that the scrolling eases. I am assuming that you would instead of say "++" you would assign a number like 3 and then divide the number by the ending point. But, even though that sounds simple enough, I'm not sure how to apply it in this sense.
Thanks
var friction = .6;
up_arrow.onRelease = function(){
var dist = this._y;
var velY = dist * velY;
}
With this code, your scrolling content will change drastically if it is further away, but will get the easing effect. To force it to scroll at a certain speed until it reaches a certain point, or, to have it continue to scroll after the button is pressed, assign an onEnterFrame when the button is released, and then continually divide a predefined distance variable by the friction:
var friction = .6;
var distToScroll = 5;
up_arrow.onRelease = function(){
this.remainingDistance = distToScroll;
this.onEnterFrame = function(){
if(this.remainingDistance <= 1){
delete this.onEnterFrame;
} else {
this.remainingDistance *= _root.friction;
this._y -= this.remainingDistance;
}
};
}
Hope that makes sense...
#If you have any other info about this subject , Please add it free.# |