Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    bottoni RoolOver RollOut Enabled

    Ciao a tutti, ho questi 8 bottoni a cui ho dato questi comandi di seguito e volevo sapere:

    se è possibile "ridimensionare" lo script 2 se una volta cliccato su un altro bottone, quello precedentemente selezionato torni al suo colore iniziale (al roll over/rollout i bottoni passano da nero ad un colore X, diverso per ognuno, per poi tornare al nero)

    il mio codice:

    /* abilitazione bottoni
    */
    function enable():Void {
    btn1.enabled = true;
    btn2.enabled = true;
    btn3.enabled = true;
    btn4.enabled = true;
    btn5.enabled = true;
    btn6.enabled = true;
    btn7.enabled = true;
    btn8.enabled = true;
    }

    btn1.onRelease = function():Void {
    trace("home");
    enable();
    this.enabled = false;
    };
    btn2.onRelease = function():Void {
    trace("services");
    enable();
    this.enabled = false;
    };
    btn3.onRelease = function():Void {
    trace("special events");
    enable();
    this.enabled = false;
    };
    btn4.onRelease = function():Void {
    trace("parties");
    enable();
    this.enabled = false;
    };
    btn5.onRelease = function():Void {
    trace("fashion shows");
    enable();
    this.enabled = false;
    };
    btn6.onRelease = function():Void {
    trace("locations");
    enable();
    this.enabled = false;
    };
    btn7.onRelease = function():Void {
    trace("clients");
    enable();
    this.enabled = false;
    };
    btn8.onRelease = function():Void {
    trace("contacts");
    enable();
    this.enabled = false;
    };
    /*azioni menu RollOver
    */
    btn1.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn2.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn3.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn4.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn5.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn6.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn7.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    btn8.onRollOver = function(){
    this.gotoAndPlay(2)
    }
    /*azioni menu RollOut
    */
    btn1.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn2.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn3.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn4.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn5.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn6.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn7.onRollOut = function(){
    this.gotoAndPlay(11)
    }
    btn8.onRollOut = function(){
    this.gotoAndPlay(11)
    }


    GRAZIE 1000
    Io_FraNo

  2. #2

  3. #3
    come detto nell'altro thread, puoi tenerti un indice dell'ultimo pulsante premuto e disabilitare solo quello.

    inoltre puoi gestire pulsanti dai nomi sequenziali con un ciclo di questo tipo:
    Codice PHP:
    for(var i:Number=1i<=8i++){
        
    _root["btn"+i].onRollOver=function():Void{
            
    trace(this._name);
        }

    array notation

    edit:magari non uppare dopo mezz'ora
    There is nothing conceptually better than Rock 'n' Roll.

    poker is very much like sex. most people think they're the best but don't know what they're doing.

  4. #4
    perdonami, non sono espertissimo di as!

    Ho messo il tuo codice nel frame, mi dice su cosa faccio il RollOver ma non fa niente di tutto il resto!

    grazie
    Io_FraNo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.