// ActionScript Programmer: T.J. Wood
// Date Created: 2/24/2007
// Date Modified: 2/26/2007
// Modified By: T.J. Wood
// -----------------------------------
// Set the ScrollPane movie clip
allScroll.contentPath = "Home_Scroll_Area_MC";
// Uncomment the following to trace vPosition and delta
// trace(maxHeight);
// Setup onMouseWheel
vScroll();
function vScroll() {
// Used to determine max px size of the ScrollPane
var maxHeight = (allScroll.content._height-allScroll.height)+20;
// Uncomment the following to trace vPosition and delta
// trace(maxHeight);
// Setup onMouseWheel
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
// Speed up the scroll... If the Mouse Wheel scroll rate times 4, minus the scroll bar position, is greater than 0 AND less than the maximum height OR the other way around...
if ((allScroll.vPosition-(delta*8))>0 && (allScroll.vPosition-(delta*8))<=maxHeight || (allScroll.vPosition-(delta*8))<0 && (allScroll.vPosition-(delta*8))>=0) {
allScroll.vPosition -= delta*8;
// Uncomment the following to trace vPosition and delta
// trace("vPos: " + _root.allScroll.vPosition + "\tDelta: " + delta);
// If that's too big, make delta one (this may be buggy)
} else {
allScroll.vPosition -= delta/3;
}
};
// Call addListener for the user's mouse.
Mouse.addListener(mouseListener);
}
// If we're set to loop, for some reason... :P
stop();