|
-
Exit an executable using a four digit string
ello peeps, I am currently completing a flash touchscreen project and have almost finished but come up against a problem that seems so simple yet I just can't get my head around it. Okay, I've created an executable that I need to close when a user enters a four digit string. The default is to exit on Esc, however, this makes it too easy for a user to be able to close the executable and then have access to the computer. I'm sure that I did a similar thing whilst a Uni (but it was oh so long ago), please help!
Thanks in advanced
-
Senior Member
Welcome!
Since this is your first thread, please read the forum rules. Thanks.
http://board.flashkit.com/board/showthread.php?t=692175
I've created an executable that I need to close when a user enters a four digit string.
What do you mean by that?
- The right of the People to create Flash movies shall not be infringed. -
-
you could have a nested if...
like say the four digit string was 1 2 3 4
you could say like
if(keypressed = 1){
if(keypressed = 2){
etc.
i dunno it might be a slow way but it'dprobably work, right? as long as you redetect the keypress after each one
-
Senior Member
well if the digits are going to be entered into a textbox, say with the instance "input" then you could use the following:
Code:
setInterval(function () {
if (input.length == 4) {
fscommand("quit", "");
}
}, 10);
just put the code on the frame
or
if there is no textbox, then you would set up a variable called "count" or something similar, then on your input handler you would increment the value of your variable by one.
a psudo example:
Code:
var count:Number = 0;
onTouch = function(){
count == 4 ? fscommand("quit", "") : count ++;
};
HTH,
zlatan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|