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
Old 3550 L3 Switch vs brand new 2851 router
Raise domain function level when there are 2 ADs
make no targets specified and no makefile found. stop
Moving_PLSQL_Code
SET FOCUS AND CHANGE COLOUR
view source code for .exe file
Convert time from localtime to EST
How should I build some records based on the index of another table?
SQL Backups / Restore
Log monitoring script