Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Fermare azione up/down

  1. #1

    Fermare azione up/down

    Ciao ragazzi, vorrei chiedervi aiuto per un'azione che ho impostato nei pulsanti che servono per far scorrere del testo.
    L'azione è questa:
    //Pulsante UP
    on (press, release, keyPress "<Up>") {
    testo._y += 10;
    }

    //Pulsante DOWN
    on (press, release, keyPress "<Up>") {
    testo._y -= 10;
    }

    Funzionano perfettamente, solo che se si continuassero a premere andrebbero avanto in eterno.
    Io vorrei che arrivati alla base del testo si fermasse l'azione.
    Quale altro comando devo impostare?
    Grazie, ciao.

  2. #2
    prova così:

    //Pulsante UP
    on (press, release, keyPress "<Up>") {
    if(testo._y < 100){
    testo._y += 10;
    }
    }

    //Pulsante DOWN
    on (press, release, keyPress "<Up>") {
    if(testo._y > 0){
    testo._y -= 10;
    }
    }

  3. #3
    Utente bannato
    Registrato dal
    Mar 2002
    Messaggi
    1,322
    on (press, release, keyPress "<Up>") {
    if (testo._y<della posizione massima){
    testo._y += 10;
    }
    }

    //Pulsante DOWN
    on (press, release, keyPress "<Up>") {
    if (testo._y>della posizione minima){
    testo._y -= 10;
    } }

  4. #4
    Utente bannato
    Registrato dal
    Mar 2002
    Messaggi
    1,322
    Originariamente inviato da dioz
    prova così:

    //Pulsante UP
    on (press, release, keyPress "<Up>") {
    if(testo._y < 100){
    testo._y += 10;
    }
    }

    //Pulsante DOWN
    on (press, release, keyPress "<Up>") {
    if(testo._y > 0){
    testo._y -= 10;
    }
    }


    scusa dioz non avevo visto

  5. #5
    non fa nulla, stiamo leggendo i post insieme e stiamo rispondendo in contemporanea, sono almeno 2 thread che lo facciamo


  6. #6
    Grazie x la dritta ragazzi.
    Sempre pronti a dare un aiuto!

  7. #7

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 © 2024 vBulletin Solutions, Inc. All rights reserved.