Im trying to optimise my code a bit so i dont have ten lines of identical code on each button. Actionscript is not my strong point. Currently on each of the menu buttons there is this code:
// sets the vertical position of all scrollbars (name0) inside their content movieclips //(name) to _y = 0
on (release) {
setProperty(“work1.carni.carni0”, _y, “0”);
setProperty(“work1.dead.dead0”, _y, “0”);
setProperty(“work1.super.super0”, _y, “0”);
setProperty(“work1.scan.scan0”, _y, “0”);
setProperty(“work1.zero.zero0”, _y, “0”);
setProperty(“work1.blow.blow0”, _y, “0”);
setProperty(“work1.pirn.pirn0”, _y, “0”);
}
what i’d like to do is some kind of function like this, which does all the work in a frame on the main timeline. For example:
on each button:
// tells every “name0” mc to set _y to 0 within their respective content movieclips
on (release) {
vertical = (_y = 0);
verticalHold(vertical);
}
on the main timeline something like this:
// Get the command from the buttons and run the function and set all “name0” _y to 0
function verticalHold(vertical) {
setProperty(allName0Clips(vertical));
}
i’ve played around with this function for loading external swfs, but i have no idea how to make it set multiple _y positions. any suggestions? what about putting all the mc names into an array (called “allName0Clips”) and doing it that way?
cheers
supernaut