I have 5 buttons and an mc with 5 text mc’s embedded after press 1 of the buttons the text mc should go in a certain y direction. This is my script:
function moveText(y) {
text_mc.onEnterFrame = function() {
this._y += (y-this._y)/5;
};
}
function setBut() {
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
this*.onRelease = function() {
moveText(-this**200);
};
}
}
}
But that is only working with one button. What am i doing wrong?