Hi all,
I want a sliding bar to move to a certain point according to which btn is pressed.
So if you presss the green btn the bar will slide so the green part is on the stage. And then slide straight to the orange if the orange btn is pressed
I did this code but it only works one way, I’m sure it cos of the += ,but I carn’t see how to alter it so it will slide both ways
[AS]
slide = function (trag) {
bar_mc.onEnterFrame = function() {
this._y += (targ-this._y)/2.5;
if (this._y >= trag) {
this._y = trag;
this.onEnterFrame = null;
}
};
};
one_btn.onRelease = function() {
slide(0);
};
two_btn.onRelease = function() {
slide(-400);
};
three_btn.onRelease = function() {
slide(-800);
};
[/AS]