I have a goofy issue going on with a drag/drop scroller. When i stop dragging the following onEnterFrame will not clear/stop unless you click on the movieclip again, then it clears.
Can one of you coder minded people see anything wrong with this? It works great, but i need it to clear as it’s taking up that precious memory
main2.onEnterFrame = function() {
if (scrollOn) {
mainTargetX = -(mainInitX-(main._width-Stage.width)*(main2._x-scrollbarInitX)/scrollAreaWidth);
} else {
scrollbarTargetX = -(main._x-mainInitX)*scrollAreaWidth/(main._width-Stage.width)+scrollbarInitX;
if (Math.abs(main2._x-scrollbarTargetX)>0.2) {
main2._x += -(scrollbarTargetX+main2._x)/2;
}
}
if (Math.abs(main._x-mainTargetX)>0.2) {
//this is where we calculate the blur distance
mainOldX = main._x;
main._x += Math.ceil((mainTargetX-main._x)/2);
mainMovement = mainOldX-main._x;
//we flur the blur distance for performance gains
//(in theory, at least; this hasn't been tested)
blur.blurY = Math.floor(Math.abs(mainMovement));
main.filters = [blur];
trace ("still going");
}else{
trace("stopped")
}
};
the code is based on this scrollbar http://oringe.com/download/blurScroll.fla