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

    menu e aree sensibili - rollOut AIUTO !!

    Ho realizzato un menu a tendina che si apre, con vari pulsanti.
    Per farlo richiudere, on inserito un a funzione che torna indietro grazie al parametro "prevFrame".

    Il problema è che deve chiudersi solo se si esce dalle aree di tutti i bottoni che si aprono a tendina, non solo all rollOut di uno solo.

    E' giusto usare l'operazione "if" per sommare tutti i rollOut ?

    Una cosa del genere:

    if (btn1.rollOut+btn2.rollOut+btnCucine.3+) {
    btnInterior.onEnterFrame = function() {
    btn1.prevFrame();
    };
    btnCucine.onEnterFrame = function() {
    btn2.prevFrame();
    };
    btnHd.onEnterFrame = function() {
    btn3.prevFrame();
    };
    }

    Aiutatemi a farlo funzionare vi prego !

    Grazie
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

  2. #2
    ho fatto un pò di confusione, questo:

    if (btn1.rollOut+btn2.rollOut+btn3.rollOut) {
    btn1.onEnterFrame = function() {
    btn1.prevFrame();
    };
    btn2.onEnterFrame = function() {
    btn2.prevFrame();
    };
    btn3.onEnterFrame = function() {
    btn3.prevFrame();
    };
    }
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    306
    direi di no, il rollout è un evento che viene invocato quando compi un'azione, non uno stato del pulsante
    io userei delle variabili, ti faccio un esempio:
    hai tre pulsanti e tre variabili
    var var1 = false
    var var2 = false
    var var3 = false
    e queste le dichiari nel frame dove stanno i pulsanti
    e poi di seguito
    btn1.onRollOut = function{//per il primo pulsante
    var1 = true
    if(var2 == true and var3 == true){
    btn1.prevFrame()
    btn2.prevFrame()
    btn3.prevFrame()
    }
    }
    btn2.onRollOut = function{//per il primo pulsante
    var2 = true
    if(var1 == true and var3 == true){
    btn1.prevFrame()
    btn2.prevFrame()
    btn3.prevFrame()
    }
    }
    btn3.onRollOut = function{//per il secondo pulsante
    var3 = true
    if(var1 == true and var2 == true){
    btn1.prevFrame()
    btn2.prevFrame()
    btn3.prevFrame()
    }
    }

    ciao
    buonuomo.tomma@tiscali.it

  4. #4
    Così funziona solo se eseguo il rollOut di tutti i pulsanti a tendina che escono al rollOver del principale.

    Cioè per far divenire tutte le var = true bisogna passare in sequenza sopra tutti i pulsanti.
    Infatti il rollOut si verifica necessariamente dopo un rollOver giusto ?

    Insomma. Il menu con i pulsanti non si richiude se esco dall'area di hover che occupano nel loro insieme. Lo fa solo se li scorro tutti.

    hint hint hint.....!
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

  5. #5
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    306
    ok, mi sa che non avevo capito di preciso cosa volessi tu
    ti serve che se quando esci da un pulsante, se non tocchi nessuno degli altri, allora esegui l'azione?
    in questo caso direi ad ogni bottone
    bottone1.onRollOut = function(){
    if(bottone2.hitTest(_xmouse, _ymouse, true)==false and bottone3.hitTest(_xmouse, _ymouse, true)){
    //esegui azioni
    }
    }

    eccetera per gli altri pulsanti

    dimmi che è questo che volevi, altrimenti spiegati in altro modo
    ciao
    buonuomo.tomma@tiscali.it

  6. #6
    ok, forse sto usando la strada più lunga Però lo considero un esercizio per me che di actionscript non ci capisco molto. Allora, io ho assegnato 4 variabili a 4 pulsanti (il primo è quello che fauscire gli altri tre a tendina).

    L'azione rollOver trasforma la variabile in TRUE, l'azione rollOut la trasforma invece in FALSE. facile no ?

    Poi ho usato un if() come questo:

    if (var1 == false and var2 == false and var3 == false and var4 == false) {
    btn2.prevframe();
    btn3.prevframe();
    btn4.prevframe();
    trace("bingo!");
    }

    Come mai però non funziona un cavolo ???
    Eppure i trace mi restituiscono
    var1 = false
    var2 = false
    var3 = false
    var4 = false
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

  7. #7
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    306
    quell'if quando viene eseguito? e i trace quando li fai?
    se esegui l'if quando non sei ancora passato su uno di quei pulsanti, la variabile non sarà mandata a false
    fai qualche prova con il debugger di flash per vedere le variabili
    ora vado a dormire, domani vedrò la tua risposta, ciao
    buonuomo.tomma@tiscali.it

  8. #8
    non mi funzionano entrambi i metodi.
    IL TUO:


    /*------------------------------------------------------------------------------------*/
    this.btnHome.onRollOver = function() {
    onEnterFrame = function () {
    btn1.nextFrame();
    btn2.nextFrame();
    btn3.nextFrame();
    };
    };
    btnHome.onRollOut = function() {
    if (btn1.hitTest(_xmouse, _ymouse, true) == false and btn2.hitTest(_xmouse, _ymouse, true) == false and btn3.hitTest(_xmouse, _ymouse, true)== false ) {
    btn1.prevframe();
    btn2.prevframe();
    btn3.prevframe();
    }
    };
    btn1.onRollOut = function() {
    if (btnHome.hitTest(_xmouse, _ymouse, true) == false and btn2.hitTest(_xmouse, _ymouse, true) == false and btn3.hitTest(_xmouse, _ymouse, true) == false) {
    btn1.prevframe();
    btn2.prevframe();
    btn3.prevframe();
    }
    };
    btn2.onRollOut = function() {
    if (btn1.hitTest(_xmouse, _ymouse, true) == false and btnHome.hitTest(_xmouse, _ymouse, true) == false and btn3.hitTest(_xmouse, _ymouse, true) == false) {
    btn1.prevframe();
    btn2.prevframe();
    btn3.prevframe();
    }
    };
    btn3.onRollOut = function() {
    if (btn1.hitTest(_xmouse, _ymouse, true) == false and btnHome.hitTest(_xmouse, _ymouse, true) == false and btn2.hitTest(_xmouse, _ymouse, true) == false) {
    btn1.prevframe();
    btn2.prevframe();
    btn3.prevframe();
    }
    };

    */ ----------------------------------------------------------------/*

    IL MIO:


    var var1 = false;
    var var2 = false;
    var var3 = false;
    var var4 = false;
    this.btnHome.onRollOver = function() {
    var1 = true;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    onEnterFrame = function () {
    btn1.nextFrame();
    btn2.nextFrame();
    btn3.nextFrame();
    };
    };
    btn1.onRollOver = function() {
    var2 = true;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btn2.onRollOver = function() {
    var3 = true;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btn3.onRollOver = function() {
    var4 = true;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btnHome.onRollOut = function() {
    var1 = false;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btn1.onRollOut = function() {
    var2 = false;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btn2.onRollOut = function() {
    var3 = false;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    btn3.onRollOut = function() {
    var4 = false;
    trace("var1 :"+var1);
    trace("var2 :"+var2);
    trace("var3 :"+var3);
    trace("var4 :"+var4);
    trace("-----------");
    };
    if (var1 == false and var2 == false and var3 == false and var4 == false) {
    btn1.prevframe();
    btn2.prevframe();
    btn3.prevframe();
    trace("bingo!");
    }



    */ ----------------------------------------------------------------/*



    Aiutooooooo ! Sento di essere vicino ad entrambe le soluzioni.....
    o no ?
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

  9. #9
    Niente, non vò funzionare il menu... Sono andato avanti ma niente.
    Qualcosa ancor ami sfugge tra le regole di sintassi...


    this.btnHome.onRollOver = function() {
    onEnterFrame = function () {
    btn2.nextFrame();
    btn3.nextFrame();
    btn4.nextFrame();
    };
    };
    this.btnHome.onRollOut = function() {
    if (this.btn2.hitTest(_xmouse, _ymouse, true) == false && this.btn3.hitTest(_xmouse, _ymouse, true) && this.btn4.hitTest(_xmouse, _ymouse, true)) {
    btn2.prevframe();
    btn3.prevframe();
    btn4.prevframe();
    }
    };




    aaaaiuto
    - DanSky
    giudansky@hotmail.com
    http://www.webalice.it/dansky

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.