Help with arrays

Hi,

I want to write this code with an array, don’t know if it’s possible…


_root.navi.vol00.onRelease = function() {
if (currentPict != 0) {
currentPict = 0;
_root.wiper._visible = true;
_root.wiper._width = 5;
_root.wiper.endwidth = 1178;
}
};
_root.navi.vol01.onRelease = function() {
if (currentPict != 1) {
currentPict = 1;
_root.wiper._visible = true;
_root.wiper._width = 5;
_root.wiper.endwidth = 1178;
}
};
_root.navi.vol02.onRelease = function() {
if (currentPict != 2) {
currentPict = 2;
_root.wiper._visible = true;
_root.wiper._width = 5;
_root.wiper.endwidth = 1178;
}
};
_root.navi.vol03.onRelease = function() {
if (currentPict != 3) {
currentPict = 3;
_root.wiper._visible = true;
_root.wiper._width = 5;
_root.wiper.endwidth = 1178;
}
};
_root.navi.vol04.onRelease = function() {
if (currentPict != 4) {
currentPict = 4;
_root.wiper._visible = true;
_root.wiper._width = 5;
_root.wiper.endwidth = 1178;
}
};
 

and so on…

Only the numbers change!

I need to do this for +80 buttons, so I was wondering if there is a way with an array I can do this all in one time.

I searched for array tutorials but didn’t succeed in transforming this code into a single array.

Suggestions are very welcome!

wouter