PDA

View Full Version : My new navigation system


Dudex
08-26-2001, 03:08 PM
More flash questions! Yay!! LoL.

Anyways, I was thinking of making a new navigator for my site. Here's how it works, it's basically like a security entrance panel. You type in a number and it shows what number you pressed. When you press the right numbers with the right combo, then it'll open up the site. This may sound a bit complicated.
Here are my questions:
1. How do you get the numbers, when pressed, to display?
2. How do you specify the correct combo of numbers and make it so that it then gos to the next frame.
Could I do name all the numbers and instance, then right it as

if(userinput=2467)
{
then(goto(3));
}

Sorry, my programming skills aren't that sharp. Or my action script skills. Could it be something like that?

Thanks

montroze
08-26-2001, 04:07 PM
This may do the trick...

<html>
<!-- creation date: 8/26/01 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>KeyPad Password</title><SCRIPT language="JavaScript">
<!-- Key-code script by Bart Jellema
// You may use this script freely as long
// as you credit me for it...
var usermulcode=24
// This is to validate the code. In this case
// the code is 1234 so the mul = 1*2*3*4 = 24
// Change this value for your own code
// If your code is 2415 it will be
// usermulcode = 40 (2*4*1*5)
var code=0 // the entered code
var mul=1 // the multiplied digits
var digit=0 // number of digits entered so far
var fails=0 // number of tries done

function Enter_code(number)
{

code=code*10+number // Add the digit to the code
mul=mul*number // Update mul-value
document.codepad.thecode.value=code // Show code
digit++ // Increase digit

if (digit==4) // Four digits entered
{
if (mul==24) // This is to validate
// the code. In this case
// the code is 1234 so the
// mul = 1*2*3*4 = 24
// Change this value for
// your own code
{
location=code+".htm"
}
else
{
fails++ // Increase fails
code=0 // Reset values
mul=1
digit=0
if (fails<3)
{
if (fails==1)
{document.codepad.thecode.value="Try again"}
if (fails==2)
{document.codepad.thecode.value="Last time"}
}
else // To many tries = worp back
{
location="java.htm"
document.codepad.thecode.value="Bye!"
}
}
}
}

function keycodepad(mulcode)
{
usermulcode=mulcode
document.write("<form name=\"codepad\">");
document.write("<input type=\"button\" value=\" 1 \" onClick=\"Enter_code(1)\">");
document.write("<input type=\"button\" value=\" 2 \" onClick=\"Enter_code(2)\">");
document.write("<input type=\"button\" value=\" 3 \" onClick=\"Enter_code(3)\"><br>");
document.write("<input type=\"button\" value=\" 4 \" onClick=\"Enter_code(4)\">");
document.write("<input type=\"button\" value=\" 5 \" onClick=\"Enter_code(5)\">");
document.write("<input type=\"button\" value=\" 6 \" onClick=\"Enter_code(6)\"><br>");
document.write("<input type=\"button\" value=\" 7 \" onClick=\"Enter_code(7)\">");
document.write("<input type=\"button\" value=\" 8 \" onClick=\"Enter_code(8)\">");
document.write("<input type=\"button\" value=\" 9 \" onClick=\"Enter_code(9)\"><br>");
document.write("<input type=\"text\" name=\"thecode\" size=10 value=\"\"><br>");
document.write("</form>");
}
// Key-code script by Bart Jellema -->
</SCRIPT></head>
<body text="#FFFFFF" link="#FFFF00" bgcolor="#000000" alink="#FFFF00" vlink="#FFFF80"><center><H1>KeyPad Password<br>
<h4>This little script is great for protecting your special things on the web. It's a lot better looking than a plain old enter name and password box. Try it out! The correct code is 1234</p>
<script>
keycodepad(24)
</script>
</body>
</html>

Dr. Web
08-27-2001, 12:03 AM
MOntroze,

Dudex was looking for a flash actionscript answer....


try these links for more.. (http://www.volcanic-design.com/volc_links.htm)


also I created something just like this in flash before using a copy of "Flash5 Magic." (great book!)It wasn't just one actionscript, but a fair number of them to achieve what you want. Still the effect was great, and worth the effort.

quietstorm
08-27-2001, 12:26 AM
You're not going to want something that displays in your code, as then people will be able to get het password (number#) by looking at the source code.

Dr. Web
08-27-2001, 01:31 AM
since this is a flash question, and the flash source is invisible to the surfer..... that wouldn't be a problem.

quietstorm
08-27-2001, 01:37 AM
Originally posted by Dr. Web
since this is a flash question, and the flash source is invisible to the surfer..... that wouldn't be a problem.

Oh, you're right. Silly me. I forgot that this was flash. I didn;t even actually read your post, but just montroze's post. I feel so stupid:o

Dudex
08-27-2001, 12:59 PM
wow, that must have taken a long time to write montroze. Well, i was looking for a flash action script. Thanks for the link. O, and i suppose I should get a good flash book. LOL

quietstorm
08-27-2001, 01:06 PM
Originally posted by Dudex
wow, that must have taken a long time to write montroze. Well, i was looking for a flash action script. Thanks for the link. O, and i suppose I should get a good flash book. LOL

montroze just copied and pasted it. And, yes, a Flash book would be good.