sono un vero novellino e di programmazione ne so poco o nulla.
mi ritrovo con una serie di if da semplificare con un ciclo, come si fa?
il codice da semplificare è questo:
if (Math.round(_root.mc1._y) == /:x) {
_root.mc1._y = Math.round(_root.mc1._y);
}
if (Math.round(_root.mc2._y) == /:x) {
_root.mc2._y = Math.round(_root.mc2._y);
}
if (Math.round(_root.mc3._y) == /:x) {
_root.mc3._y = Math.round(_root.mc3._y);
}
if (Math.round(_root.mc4._y) == /:x) {
_root.mc4._y = Math.round(_root.mc4._y);
}
if (Math.round(_root.mc5._y) == /:x) {
_root.mc5._y = Math.round(_root.mc5._y);
}
if (Math.round(_root.mc6._y) == /:x) {
_root.mc6._y = Math.round(_root.mc6._y);
}
if (Math.round(_root.mc7._y) == /:x) {
_root.mc7._y = Math.round(_root.mc7._y);
}
if (Math.round(_root.mc8._y) == /:x) {
_root.mc8._y = Math.round(_root.mc8._y);
}
if (Math.round(_root.mc9._y) == /:x) {
_root.mc9._y = Math.round(_root.mc9._y);
}
if (Math.round(_root.mc10._y) == /:x) {
_root.mc10._y = Math.round(_root.mc10._y);
}
if (Math.round(_root.mc11._y) == /:x) {
_root.mc11._y = Math.round(_root.mc11._y);
}
if (Math.round(_root.mc12._y) == /:x) {
_root.mc12._y = Math.round(_root.mc12._y);
}
grazie degli eventuali suggerimenti

Rispondi quotando