Microsoft
Software
Hardware
Network
Question : Mouse wheel action on scroller
Greetings,
I have a MovieClip that scrolls with created dragger and buttons and would like to get the MovieClip to also scroll with the mouse wheel in Actionscript 2.
My script follows:
scrolling = function () {
var scrollHeight:Number = scrollbg._height;
var contentHeight:Number = contentMain._height;
var draggerHeight:Number = dragger._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = dragger._y=scrollbg._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+i
nitContent
Pos;
var left:Number = scrollbg._x;
var top:Number = scrollbg._y;
var right:Number = scrollbg._x;
var bottom:Number = scrollbg._height-draggerHe
ight+scrol
lbg._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)
/(scrollHe
ight-dragg
erHeight);
dragger.onPress = function() {
dragger.draggerover._alpha
= 100;
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dragger.draggerover._alpha
= 100;
dy = Math.abs(initPosition-this
._y);
contentMain._y = Math.round(dy*-1*moveVal+i
nitContent
Pos);
};
};
dragger.onMouseUp = function() {
dragger.draggerover._alpha
= 0;
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y+speed<mask
edView._y)
{
if (dragger._y<=top) {
dragger._y = top;
} else {
dragger._y -= speed/moveVal;
}
contentMain._y += speed;
} else {
dragger._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
btnUp.upover._alpha = 0;
};
btnUp.onRollOut = function() {
delete this.onEnterFrame;
btnUp.upover._alpha = 0;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y-speed>fina
lContentPo
s) {
if (dragger._y>=bottom) {
dragger._y = bottom;
} else {
dragger._y += speed/moveVal;
}
contentMain._y -= speed;
} else {
dragger._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
btnDown.downover._alpha = 0;
};
if (contentHeight<maskHeight)
{
dragger._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
dragger._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();
Any help with this would be greatly appreciated.
Thanks
Mark
Answer : Mouse wheel action on scroller
best option it to just roll out the new RDB ... it's much safer.
If the remote user has data changes they want to keep, then you'll need to import the old remote into the new one before deleting it
Random Solutions
Wifi network not able to print from the network printer
txtbox client side
How to solve SQL Server 2008 R2 error, cannot connect to SQLSERVER error 53
Data Insurance Co.- Know One?
Replication errors on new Windows 2008 RC DC's
MS SQL 2005 backup strategy with Transaction Log handling
Can not wake PC which has no monitor, mouse or keypad
Administrator and Run as Administrator Windows 7 - the difference
alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
jvm default socket address