Acces code script

This is a discussion on "Acces code script" within the Flash & Multimedia Forum section. This forum, and the thread "Acces code script are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 24th, 2007, 23:21
New Member
Join Date: Jun 2007
Location: Holland
Age: 18
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Acces code script

Hi Im very new to actionscripts and such so Id be happy if you could help me out. Heres my situation, Ive made an entire graphical layout for a flash movie with a numpad (which will be buttons) and I want to have an acces code you have to enter in to get to the next frame. So for instance you have to press button1, button4, button9 and button6 to get to the next frame otherwise if you enter the wrong combination you should be directed to a different frame.

Thanks alot!
Reply With Quote

  #2 (permalink)  
Old Jun 25th, 2007, 04:38
Junior Member
Join Date: Jun 2007
Location: Arkansas
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Acces code script

This is wholly a guess, but here are my thoughts. It will/should work, but it might be a long way around it.

This is an outline of what you could do.

Set a variable x=0. When you depress any number, the count increases by one. Check the number of keypresses after you increase it. Hence, when you press the first number, the number increases to 1, and then checks to see if the count is 4. It also sets a value of that number to a variable. When you press the second number, it increases to 2, and sets that number to a variable. Same with the 3rd and 4th, but then when count equals 4 it then checks to see on another variable.

var NumTotal = number of keypresses
var NumCode1 = first key pressed
var NumCode2 = second key pressed
var NumCode3 = third key pressed
var NumCode4 = fourth key pressed

var Code1=2
var Code2=7
var Code3=3
var Code4=5

if NumCode1 = Code1 then
if NumCode2= Code2 then
if NumCode3=Code3 then
if NumCode4=Code4 then
open the webpage
else
call them a loser and send them home to mama


I know, it's rough, but it's only meant as an idea, not full working code.

If someone sees an error, please fix.

I hope this helps
Reply With Quote
  #3 (permalink)  
Old Jun 25th, 2007, 14:54
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sgaspar11
Re: Acces code script

More ideas around this might be even easier than this but you are on the right track.

So you need them to press 4 different buttons.

Create a Variable:

Var TotalNumber();

On each button that you want to have them push have something like:

TotalNumber = TotalNumber+1; which sets a counter to add up to whatever number you want.

Then use an if statement around when TotalNumber = 4 go to frame x, else keep counting.

When it goes to the next frame you can reset the variable to 0 if you want to do the randomized sequence again.

The only other thing you would have to do is disable buttons on keypress that way they don't just click one of the buttons 4 times to advance.

A video on how to do that:
http://www.oman3d.com/tutorials/flas...isablebuttons/

Cheers,

Scott
Last Blog Entry: Yay!? (Oct 8th, 2007)
Reply With Quote
Reply

Tags
acces, buttons, code

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
live search code and styleswitcher code hebel JavaScript Forum 0 May 12th, 2007 06:16
PHP Code Editor script needed Marc PHP Forum 6 May 5th, 2007 16:31
I want ecards Java Script code. Anybody help 2 me. naagoo JavaScript Forum 1 Oct 28th, 2006 14:47
Can somebody give me the code to hide the source code? renren JavaScript Forum 7 Mar 7th, 2006 12:27
Excel - acces table link tolis Databases 1 Dec 19th, 2005 17:54


All times are GMT. The time now is 07:45.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43