Ok. I already posted this to the Actionscritp Forum (is that bad? :*() but it seems like nobody’s hanging out there today. So…
I’m trying to learn a better way to make a mc scroller with up/down buttons that scroll onPress and stop scrolling onRelease, but ease into place.
I’m using this on the first frame:
[AS]MovieClip.prototype.easeScale = function (finalx, finaly, speed) {
this.onEnterFrame =function () {
this._x += Math.floor ((finalx- this._x )/speed);
this._y += Math .floor ((finaly- this ._y )/speed);
if (Math.abs (this._y - finaly) < .001) {
delete this.onEnterFrame;
}
};
};[/AS]
… and on the up button I have:
[AS]
on (press) {
fagraText_mc.easeScale(0, 31, 9);
}
on (release, dragOut) {
if (fagraText_mc._y >= 31){
fagraText_mc.easeScale(0, 31, 6);
}
else {
fagraText_mc.easeScale(0, (fagraText_mc._y + 10), 6);
}
}
[/AS]
…and on the down button:
[AS]on (press) {
fagraText_mc.easeScale(0, (fagraText_mc._y - fagraText_mc._height), 10);
}
on (release, dragOut) {
fagraText_mc.easeScale(0, (fagraText_mc._y - 10), 6);
}
[/AS]