salve, come potrei semplificare questo script visto che le "voci" saranno un centinaio?
bottone.onPress=function() {
this.onEnterFrame=function(){
if (_root.bottone_premuto == true) {
_root.campo_errore.text = ""
if (_root.ctrl_scala.cursore._x<=0){
_root.ctrl_scala.cursore._x=0
}
if (_root.ctrl_scala.cursore._x>=_root.ctrl_scala.bar ra._width){
_root.ctrl_scala.cursore._x=_root.ctrl_scala.barra ._width
}
_root.fatt_scala(_root.ctrl_scala.cursore._x)
_root.rdm_cursore()
if (_root.cont.prova1.text == "seconda voce") {
ctrl_scala.cursore._x=20;
map._y = 113;
map._x = -50;}
else if (_root.cont.prova1.text == "terza voce") {
ctrl_scala.cursore._x=20;
map._y = 50;
map._x = -20;
}
else {
_root.campo_errore.text = "elemento non trovato"
}
}
}
}
bottone.onRelease=function(){
delete this.onEnterFrame;
}
Grazie