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.
|
|
|
|
|
![]() |
||
Acces code script
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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! |
|
|
|
|||
|
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 |
|
|||
|
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)
|
![]() |
| Tags |
| acces, buttons, code |
| Thread Tools | |
|
|
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 |