Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    22

    aiuto sto impazzendo non trovo la soluzione

    Questo riportato qui sotto è il mio codice per far si che se una linea che scorre incontra dei quadratini, suona una nota.
    This nel codice è la nota, e sta al posto movieclip duplicati ogni volta che clicco col mouse, quindi this puo' essere "mc1, mc2 , mc3 etc".

    Il mio problema è sorto dal fatto che con una linea che incontra un altro oggetto(nota) con la hitTest non c'è modo almeno penso di far si che durante l'incontro mi generi una sola azione, ma me le continua generare fino a che la linea non supera la nota..

    Quindi o dovuto creare la variabile tocco..
    Il mio problema adesso è che non riesco più a riportare la variabile
    tocco a false e quindi a riascoltarle un'altra volta.
    Ho provato aggiungere alla fine del codice questo:
    if (_root.reset == true) {
    tocco = false;
    _root.reset = false;
    }

    ma non c'è niente da fare....perchè
    Se qualcuno mi puo' rispondere ne sarei molto grato..








    onClipEvent (load) {
    tocco = false;
    }
    ///////
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.linea) and tocco == false) {
    if (this.hitTest(_root.uno.due.pentaunodo)) {
    _root.suoni.gotoandplay(2);
    tocco = true;
    }
    if (this.hitTest(_root.uno.due.pentaunore)) {
    _root.suoni.gotoandplay(3);
    tocco = true;
    }
    if (this.hitTest(_root.uno.due.pentaunomi)) {
    _root.suoni.gotoandplay(4);
    tocco = true;
    }
    }
    }

  2. #2
    prova a mettere una variabile contatore
    lo setti a zero
    sull'enter frame aggiungi 1
    e poi fai il controllo...

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    22
    non capisco....
    Me lo puoi spiegare meglio....

  4. #4
    onClipEvent (load) {
    contatore = 0;
    }
    ///////
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.linea) and tocco == false) {
    ***** qui inserisci il controllo *****
    if (contatore == 0) {
    if (this.hitTest(_root.uno.due.pentaunodo)) {
    _root.suoni.gotoandplay(2);
    contatore++;
    }
    }
    }
    }


    dacci un occhio e scrivilo poi tu come meglio sei abituato

  5. #5
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    22
    e ma questa è la stessa cosa che ho fatto con la variabile tocco...
    Il mio problema è dopo,cioè riportare la variabile "tocco" o la tua variabile "contatore" rispettivamente a false o a zero..

  6. #6
    allora....
    metti un comando sull'enter frame che setta la variabile contatore a 0 se la linea non è sopra la nota


    onClipEvent (enterFrame) {
    if (this.hitTest(_root.ciccio)) {
    //qui fai succedere quello che deve ;
    } else {
    //cioè quando la linea esce dalla nota
    contatore = 0;

    }
    }

  7. #7
    onClipEvent (load) {
    contatore = 0;
    }
    ///////
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.linea)) {
    ***** qui inserisci il controllo *****
    if (contatore == 0) {
    if (this.hitTest(_root.uno.due.pentaunodo)) {
    _root.suoni.gotoandplay(2);
    contatore++;
    }
    }
    } else {
    //cioè quando la linea esce dalla nota
    contatore = 0;
    }
    }

    te lo posto con il tuo codice anche

  8. #8
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    22
    Questo è il mio codice completo....continua a suonare ogni nota più di una volta prima che la linea superi la nota..........




    onClipEvent (load) {
    contatoree = 0;
    }
    ///////
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.linea) and contatoree == 0) {
    if (this.hitTest(_root.uno.due.pentaunodo)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(2);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunore)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(3);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunomi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(4);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunofa)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(5);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunosol)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(6);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunola)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(7);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaunosi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(8);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduedo)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(9);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduere)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(10);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduemi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(11);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduefa)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(12);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduesol)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(13);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduela)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(14);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaduesi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(15);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatredo)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(16);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatrere)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(17);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatremi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(18);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatrefa)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(19);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatresol)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(20);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatrela)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(21);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentatresi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(22);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaquattrodo)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(23);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaquattrore)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(24);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    if (this.hitTest(_root.uno.due.pentaquattromi)) {
    this.gotoandplay(2);
    _root.suoni.gotoandplay(25);
    _root.n++;
    contatoree++;
    _root.conteggio++;
    }
    } else {
    contatoree = 0;
    }
    }

  9. #9
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    22
    Avevo sbagliato a mettere gli IF nel codie...adesso funziona grazie milleeeee......

  10. #10
    non ho capito...quindi funza???


    !!

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.