venerdì 3 ottobre 2014

Chiedere la password

Per chiedere la password basta lanciare il comando:

ask password "Inserire la password:"


Con un po' di fantasia si può anche utilizzare l'immagine di un lucchetto di dimensione 10x11 pixel. Importiamo l'immagine che vogliamo utilizzare nel campo password e poi immettiamo nel campopassword il seguente codice:

on rawKeyDown
    send hideMyKeys to me in 0 seconds
    pass rawkeydown
end rawKeyDown

on hideMyKeys
    lock messages
    lock screen
    repeat with i = 1 to the number of characters in me
          if the imagesource of char i of me is not "lucchetto" then
               set the imagesource of char i of me to "lucchetto"
          end if
    end repeat
    unlock messages
end hideMyKeys

e otterrete qualcosa di simile a questo:
Oggi abbiamo imparato come sostituire ad un qualsiasi carattere un'immagine sfruttando la proprietà imagesource. Le applicazioni sono infinite: videogiochi, report, font.

Nessun commento:

Posta un commento