I’ve got a clip which gets multiple clips attached dynamically. I’d like to make it scroll up or down based on user mousing over it and mouse position.
I want it to ease and to increase in speed if the user mouses further up or down…
so far, my attempt is pretty pitiful… any advice or code examples would be great!
code:
menuClip.onEnterFrame=function(){
if (this.hitTest(_root._xmouse, _root._ymouse) && _root._ymouse < this._y+228 && _root._ymouse > this._y) {
trace("menu pos: "+this.holder._y);
if (_root._ymouse < centerPoint-26 && holder._y<0){
trace("above center");
//change speed
if(_root._ymouse > (centerPoint-26)-13){
var t1:Tween = new Tween(holder, "_y", Strong.easeOut, holder._y, holder._y+1, 1, false);
};
if(_root._ymouse < (centerPoint-26)-13){
var t1:Tween = new Tween(holder, "_y", Strong.easeOut, holder._y, holder._y+3, 1, false);
};
};
if (_root._ymouse > centerPoint+26 && holder._y>botBounds){
trace("below center");
if(_root._ymouse < (centerPoint+26)+13){
var t1:Tween = new Tween(holder, "_y", Strong.easeOut, holder._y, holder._y-1, 1, false);
trace("moving down slow");
};
if(_root._ymouse > (centerPoint+26)+13){
var t1:Tween = new Tween(holder, "_y", Strong.easeOut, holder._y, holder._y-3, 1, false);
trace ("moving up fast");
}
}
}
}
it’s a friggin mess, i know!