I've wrote a listener to scroll a window that has been masked. So far I have come up with this:
The scrolling and scrolling acceleration (16 = Shift) works but I don't know how to limit it. I want to prevent it from scrolling beyond the beginning and ending of the clip that was masked. Please let me know if I missed any information I should have provided.
Thanks.
---------------------------------------
TINSTAAFL, which is why I contribute.
Code:
// Attach mouse wheel scroll listeners.
_global.mWheel = new Object ( );
mWheel.onMouseWheel = function ( delta:Number )
{
// Recalculate delta.
delta *= 3;
// Shift being held down?
if ( Key.getCode( ) == 16 )
{
// Speed up more.
delta *= 2;
}
// Get new position.
newPos = _root.catpg._y + delta;
// Scrolling Down?
if ( newPos < _root.catpg._y )
{
// Reached end of page?
if ( ( _root.catpg._height - newPos ) )
;
trace( _root.catpg._height - newPos );
}
// Scrolling up?
else
{
}
_root.catpg._y = newPos;
}
Mouse.addListener( _global.mWheel );
The scrolling and scrolling acceleration (16 = Shift) works but I don't know how to limit it. I want to prevent it from scrolling beyond the beginning and ending of the clip that was masked. Please let me know if I missed any information I should have provided.
Thanks.
---------------------------------------
TINSTAAFL, which is why I contribute.