?
Solved

Basic Flash page that can store 20 name in array without using database

Posted on 2003-03-09
11
Medium Priority
?
185 Views
Last Modified: 2010-04-03
Hi everyone,

I have to create a Flash page and put inside user Id  and password label, text box and button.

The user name and password will check in Flash without using any database or asp page. I want to store 20 name and password in flash array. And when user enters their information FLASH try to check if user id and password correct.

I want to use 20 array and each array must hold user name and password.I do know how to do in C++ and VB but I am too new in Flash.

Example 01_LoginArray(1) If flash array starts from element 0 then element 0 holds user id for 01_LoginArray(1) and element 1 holds the password.

Then we will use (for next) loop to check the all 20 array and see if we success.

If we not success we must shows Denied Access in flash and that user try again or show links for previous html page or (home page in html), and
if we success we must show flash page that has 10 links inside and user selects any link and download the document in zip file.

I saw too many *.fla file but nothing satisfy me. I decide to do like in above.
In this way some server that do not support any script and asp page
can use above solution that provide home user to publish their web site.

This is my home work. I know this is not the westand we dont have enough resorcues such as telefeon connection or high speed access. We still use 33.6 and 56kbs access and we have few australian server. They are old and donot support script to run in their server.

I hope you can help me (us). If you send me solution with clear understanding documentation we will be glad.

Thank you very much.
Giki Cikmaz
gikicikmaz@yahoo.co.uk
0
Comment
Question by:gikicikmaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8100207
I made a quick FLA as an example:

http://www.elementfixe.net/ee/pw.fla

Here is the code:

usernames = new Array("user1", "user2", "user3", "user4", "user5");
passwords = new Array("pw1", "pw2", "pw3", "pw4", "pw5");
success = false;

function checkLogon(){
     for(i in usernames){
          if(username == usernames[i] && password == passwords[i]){
               success = true;
          }
     }
     if(success){
          gotoAndStop("success");
     }else{
          gotoAndStop("failed");
     }
}
stop();

//the button has the script
on(press, keyPress"<Enter>"){
   checkLogon();
}



So what this does is, make an array of names and an array of passwords.  The index for names corresponds with the correct password in the passwords array.  i create a variable "success" to check if there was a match.

the checklogon function will go iterate through the entire length of the usernames array.  At each iteration, it will check to see if that value you gave for username and password, is equivalent to ones that are in the arrays.  if a match is found, success is now true.

at the end of the function, the value of success is evaluated.  if true, it sends you the the frame labeled success, otherwise to the frame labeled "failed"

enjoy.

-styles

0
 

Author Comment

by:gikicikmaz
ID: 8100303
Thank you.

I will try first the link you provide.
I must say I don not anything flash and scares me more than C++. It's good job you did.

But I must use 15 characters name and password for security. Otherwise one Id can much in any one on 20 Id in aray.

My thinking was bit complex. I want to do 20 array and each array holds 2 element. In thgis way I can narrow the security issue.

But I am going to try your one now. It was qucik response and I am thankfull to you.

Regards,
Giki Cikmaz
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8100386
C++ scares me more than flash! :)

I just coded 5 names above for simplicity.  You can add as many more names as you want.  It sounds like you are trying to use multi-dimensional arrays, which I don't think Flash supports, directly.  maybe you can construct your own in flash, (???) but i never tried.....

you can make 20 arrays if you wanted, but the looping would be so much more difficult and time consuming to code.  if that is definitly the way you want to go, let me know and i can write something up for you.

-styles
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ocgstyles
ID: 8100578
it didn't take as long as i thought, just more of a pain to create all the extra arrays, download the FLA and take a look.....

http://www.elementfixe.net/ee/pwv2.fla

enjoy

-styles
0
 

Author Comment

by:gikicikmaz
ID: 8100653
Thank you very much. I will download second *.fla.
I try the first one and it was good. Second one will be more secure than first one.

My problem is I fell so alien to Flash Layout. Accesing action part and see script is not much different than the other language. But Flash seems more complex. I had download some study material but I guess I need Visual Learning tool for Flash.

Now my problem is in the success section I want to add link for zip file.

Say If I compile this project and put it in html and upload the remote server that publish the web site, I want user to access the page after succesful log in and success page will provide up to 20 link. And each link calls zip file that user can download.

Example I have a document about part of the C++ code and I put it in zip file. The user when they need that code they will access the web site, enters the right page that flash file is publish and use the flash to Log In and if succesfull they will see succesful page that contains example: (pointer-array in C++).zip
and few more.

Now I know I have to convert the text label to button. But what kind of acction I must add that fires the action to download the zipfile.

I check the fscommand but wasn't helpful at all. Can you send me the action that shows the how to download the zip file.

Thank you very much for all your kind experties.

Regards,
Giki Cikmaz
0
 

Author Comment

by:gikicikmaz
ID: 8100697
Wowwww!

Second one was PERFECT. And after I see code I think i am going to love the Flash Action. Second code was same as MS C++. And already replace the first one.

I try to increase the points to 100 but I didn't have enough point to do that.

I will complete rest of the array, and it is more secure than before. Thank you very much. It was quick response and Perfect answer.

Thank you.

Regards,
Giki Cikmaz

0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8100735
//attach this to a button
on(press){
  getURL("myZipFile.zip");
}


when you press the button, it would call your default application for the ZIP filetype.  getURL is commonly used to open new browser windows with a URL, but it works for other file types too.

-styles
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8100738
my pleasure! =)
0
 

Author Comment

by:gikicikmaz
ID: 8100800
Thank you it was greate exprience for me to get quick response and perfect answere about Flash.

Thank you very much.
Regards,
Giki Cikmaz
0
 
LVL 5

Accepted Solution

by:
ocgstyles earned 200 total points
ID: 8100809
don't forget to accept an answer.  =)

-styles
0
 

Author Comment

by:gikicikmaz
ID: 8101127
Quick response and Perfect solution. Makes me to love Flash :))))

Best Regards
Giki Cikmaz
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question