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
utl_file
sending fax via computer
php pchart problem: pie graph with PIE_PERCENTAGE_LABEL
Crontab job till particular date
Saving and renaming a image file
Insert Line feed in access from php
Multiple monitor issue using Citrix
iconv : illegal input sequence at position
System Restore not working, and cannot repair it
Windows Mobile 6 no longer synch with Outlook 2007 (in WIndows 7)