Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 12th, 2003, 05:56 AM
diceman diceman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: UK (Essex)
Posts: 2 diceman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Creating Passwords!

Hi,

New to flash, and need some help with the following:

Creating a new website in Flash 6 have created a scene called downloads, i need to know how to:

1. Create username's and passwords for different users but also assign those usernames and passwords to different areas for example user 1 can go to scene x only and user 2 can go to scene y only.

i'm sure someone out there can help me please?

Reply With Quote
  #2  
Old June 25th, 2003, 06:22 AM
snapple snapple is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 12 snapple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
diceman,

if you still need this doing, then just drop me a mail and i'll be happy to wack a *fla up for you in no time at all. If you still need it ?

Regards, snapple

Reply With Quote
  #3  
Old June 25th, 2003, 01:36 PM
featuredhost featuredhost is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: India
Posts: 6 featuredhost User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 2 sec
Reputation Power: 0
Send a message via Yahoo to featuredhost
hi snapple ,
would you care to share the code / file with rest of us here?

Reply With Quote
  #4  
Old June 26th, 2003, 06:46 PM
snapple snapple is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 12 snapple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is a very simple version, and could be done better by puting all paswords in an array - it would make it easier to update, but simple is good for now :
PHP Code:
 on (releasekeyPress "<Enter>") {
        if (
password eq "allowed") {
                
nextMovie="specialArea.swf";
            
_root.cover.gotoAndPlay("close");
        }else{
            
nextMovie="sorry.swf";
            
_root.cover.gotoAndPlay("close");
            
        }
        



snapple

Last edited by snapple : June 27th, 2003 at 04:03 AM.

Reply With Quote
  #5  
Old June 27th, 2003, 03:30 AM
diceman diceman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: UK (Essex)
Posts: 2 diceman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passwords

Hi Snapple,

Thanks very much mate, could you give an example with two different passwords in it so i know what to do for lets say 5 different movies and passwords.

would be most grateful if you can show this for me!

Diceman.

Reply With Quote
  #6  
Old June 27th, 2003, 04:51 AM
snapple snapple is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 12 snapple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
diceman,

btw - should have mentioed that "passwords" is the var name for the textfeield on the the root.

Well, you can do it this way:

PHP Code:
 on (releasekeyPress "<Enter>") {
        if(
password == "area"){
                
gotoAndPlay("areaNew");
        }else if(
password == "allowed"){
                
getURL("allowed.htm""_blank");
        
gotoAndStop("userArea");
                
        }else{
              
gotoAndStop ("notAllowed");
       }



So thats basically giving the intepretor loads of else statements, that works fine.



Hope this is of help.

Snapple

Last edited by snapple : June 27th, 2003 at 08:06 AM.

Reply With Quote
  #7  
Old June 29th, 2003, 05:21 AM
snapple snapple is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 12 snapple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
..........but that can lead to a bit of monitor hitting when changing passwords, so you could just write a function to check an array, like this:

PHP Code:
var passArray = ["sam""bruno""jack""martin""pat"];

function 
checkPass(){
    for(var 
0passArray.lengthi++){
    if(
enterArea == passArray[i]){
        
trace("your in");
        }
            
    }




then on the button have this:

PHP Code:
 on(release){
checkPass();



snapple

Reply With Quote
  #8  
Old July 3rd, 2003, 12:27 PM
blatant's Avatar
blatant blatant is offline
World Domination
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: San Diego
Posts: 126 blatant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 17 sec
Reputation Power: 6
Send a message via AIM to blatant
I don't know if each user has a unique password, or if you want to validate users as well, but if you wanted to check that user enters their own password, I would set up an accociative array:
PHP Code:
 passwords["user1"] = "password1";
passwords["user2"]= "password2";
 . . . 

and then just make one check, avoiding the loop:
PHP Code:
if(passwords[user] == password) {
     
//grant access
}
else {
  
// deny access


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Creating Passwords!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway