Hi i am doing an elastic menu and i wanna adjust the code in wich instead of using buttons to call the sections i would like to use a prev and next buttons(so basically the sections will be jumping just one at the time) and when the next or the prev reach the ends be inactive
I don’t know if it is clear(my english is bad as much as my AS skills…)
This is the code:
Stage.scaleMode = “noScale”;
this.createEmptyMovieClip(“centerPoint”, depth++);
centerPoint._x = sectionContainer.section1._x;
centerPoint._y = sectionContainer.section1._y;
var paddingX = sectionContainer._x;
var paddingY = sectionContainer._y;
function easeTo(sectionNumber) {
var sX = sectionContainer[sectionNumber]._x;
var sY = sectionContainer[sectionNumber]._y;
var endX = centerPoint._x-sX+paddingX;
var endY = centerPoint._y-sY+paddingY;
sectionContainer.onEnterFrame = function() {
this.speedX += (endX-this._x).5;
this.speedY += (endY-this._y).5;
this.speedX *= .8;
this.speedY *= .6;
this._x += Math.round(this.speedX);
this._y += Math.round(this.speedY);
};
}
for (var i = 1; i<=14; i++) {
this[“button”+i].goSection = “section”+i;
this[“button”+i].onRelease = function() {
easeTo(this.goSection);
};
}
Thanks a lot 4 your help
Massimo