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
How do I uninstall Symantec Backup Exec 11d in Windows Server 2003??
Journaling for Exchange 2003
The multi-part identifier could not be bound and Ambiguous column name in SQL Server 2008
Centering text in header of collapsible panel
C# book or link having Java perspective?
Set up a Site-To-Site VPN between 2 CISCO ASA 5505
Can someone please how me how to merge two sorted linked lists in c#? It's for interview btw..
How to sort sites in history as last used in IE 8?
Change Color Category to Appointment in VBA
VBS persistant drive mapping