I am quite new to actionscripting and have tried to follow this tutorial but I don’t really understand it. Can somebody be so kind as to give me a step-by-step walk through the tutorial? I can’t seems to be able to contact the author
LOL, I know that feeling, have struggled with it as well.
I remade it a bit, hope you can understand this better, the AS is commented.
It’s made so, that if you want to change the width of the “sections”, you don’t have to change the AS (as long they’ve all the same width…)
MovieClip.prototype.move2 = function(tar) {
this.onEnterFrame = function() {
this._x = tar-(tar-this._x)/1.2;
// if the difference between target and the menu position is smaller as 1
// set menu to target value and delete the onEnterFrame
if (Math.abs(tar-this._x)<1) {
this._x = tar;
delete this.onEnterFrame;
}
};
};