PDA

View Full Version : Sending Variables Server Side for a Password protected site


seemsabitflashy
05-16-2002, 03:23 PM
Hello everyone! I'm new here and to the actionscripting world, so please bare with me. Here's the sitch of what I want to create.

We are creating a site that needs a USER NAME and PASSWORD entry to access their personal info( 128 bit SSL Encryption ...SQL Server I believe( not sure on the server?). We want to use Flash for the interface. Here's the details:

1. User inputs text into fields, presses login button.

2. An animation plays while the variables are passed to the server for conformation. ( VARIFYING PASSWORD...yada yada yada :D )

3. Animation stops and returns a YEAH or NEAH answer, then either sends them to their personal page or sends them back for another try at the login.

Yes this probably sounds easy to most of you, but since I have minimal experience in the actionscripting and programming world, I'm seeking some help. I deeply appreciate any help you can give.

Mike

mozilla
05-16-2002, 03:28 PM
how bout that? (http://www.actionscripts.org/tutorials/beginner/Password_protected_pages/index.shtml)

MOZ

seemsabitflashy
05-16-2002, 03:45 PM
Thank you MOZ, but I think its a bit more complicated. Considering there will be or at least up to thousands of users creating their own passwords and then loging in. It also is sending the password to a database, then retrieving a HTML page. I can't write the password into the actionscript. I was reading about this type of function in the Actionscript Reference Guide. I believe I was looking in the right direction, but was having a bit of trouble understanding the use of code....XML object...etc.......etc...

mozilla
05-16-2002, 03:58 PM
details give clearer information about what you want. )

well some sort of backend machinery will be necessary which brings us to the question: what kind of services will be available on the host? php, asp, cfm?
from my view/experience a php/mysql thing seems most likely.

i suggest you change the forum to scripting/backend.

MOZ

seemsabitflashy
05-16-2002, 04:27 PM
Yes details are good...sorry for not givign the right ones. I'm contacting our backend programmer and waiting for his response since he is in another state....I appreciate your help..Thank you...I should post another thread by end of day.

tg
05-16-2002, 08:12 PM
sounds like most of your code for password verification will be handled by whatever language you folks are using as a server script. php,asp,jsp,cfml etc.

in flash you would just make a logon screen with input boxs for username and password and a submit button. when the button is clicked, your actionscript would look like:

this.loadVariables("myVerificationScript.asp","POST");


if you put this form in a movieclip, then you can use this to catch the result of your loadVariables() action.

//put this ON the movieclip that holds your form
onClipEvent(data){
if(passed){
//put your code in here to enter the site/page
}else{
//send the bum packing
}
}

the event will fire when the flash file receives data from the asp page.
this would work pretty much the same no matter which scripting language was used.

seemsabitflashy
05-16-2002, 08:18 PM
This message is very similiar to the previous post, except that I'm new here and to the actionscripting world, so please bare with me. Here's the sitch of what I want to create.

We are creating a site that needs a USER NAME and PASSWORD entry to access their personal info( 128 bit SSL Encryption ...SQL Server 2000..ASP communication.). We want to use Flash for the interface. Here's the details:

1. User inputs text into fields, presses login button.

2. An animation plays while the variables are passed to the server for conformation. ( VARIFYING PASSWORD...yada yada yada )

3. Animation stops and returns a YEAH or NEAH answer, then either sends them to their personal page or sends them back for another try at the login.

In other words: How does my flash file need to be setup to pass the variables(User name and password) to the SQL server and play an animation while its checking.

Yes this probably sounds easy to most of you, if not all of you, but since I have minimal experience in actionscripting and I'm not a crack shot programmer, I'm seeking some help. Keep in mind....I understand how programming is implemented, but I'm primarily a designer and have had no experience with SQL. I am working with a programmer, but he's never used FLASH. So I need to understand how to talk to him.....:D

I deeply appreciate any help you can give. :cool:

Mike

seemsabitflashy
05-16-2002, 08:29 PM
TG,

I was just taking MOZ's advice and putting it in the correct forum. I had already posted this prior to receiving an email confirming your response to my previous post. I appreciate your advice. I'm just currently trying to figure it out. If you have a sample file, I would greatly appreciate it. If not, no prob...I'll figure it out sooner or later. Thanks!

Mike

seemsabitflashy
05-22-2002, 04:49 PM
Hey TG,

I believe I'm on the right track, but I have a question. What would go in the (Passed) field....I'm guessing a statement that verifies what the ASP page returns...do I need to know what's in the ASP code to write this line. So if the ASP code writes the word "true", what would the text look like that I need to write in the (Passed)field? If I'm not expaining myself correctly, I apologise. Here's the file I'm working on. If you can just take a look at it....I'd appreciate it. Thank you!

Mike

tg
05-22-2002, 07:59 PM
your asp:

<%@ Language=VBScript %>
<%
dim sCombination

sCombination = Request.Form("Combination")

if sCombination = "123456" then
Response.write "true"
else
Response.write "false"
end if
%>

change to:

<%@ Language=VBScript %>
<%
dim sCombination

sCombination = Request.Form("Combination")

if sCombination = "123456" then
Response.write("passed=true")
else
Response.write("passed=false")
end if
%>


when the 'data' event of the movieclip happens it will see the variable passed = "true" (this is a string, not a boolean value). so change the data event to look like this:

onClipEvent(data){
if(passed=="true"){
//send the user on to their home page
}else{
// stop them here
}
}

seemsabitflashy
05-22-2002, 08:32 PM
Oh boy,

I changed everything as you did(verbatum), but it just sits on the waiting section loop. Here's my updated file.....First I loaded the variables in the submit button then it goes to a frame that contains a movieClip(which has the OnClipEvent on it) were you able to do this with my file and get it working?

tg
05-22-2002, 10:41 PM
made some slight changes to your fla.
1. i put your submit button inside a mc.
2. on press i create a 'Combination' var and load it with what is in the textbox on _root.
3. i put the onClipEvent(data) on the mc with the button
4. i changed your asp file from:'passed==true' to: 'passed=true'

if you want reasons for the changes, email me.

here it is... worked for me.

seemsabitflashy
05-23-2002, 06:31 PM
Just checking to see if you received my last email.....I'll be around till 6:00pm EST. tonight.

Mike

tg
05-23-2002, 07:01 PM
yep, i sent a reply... my guess is it is a web server configuration. i won't be around till monday evening pacific time.
...well maybe tonight, but then i'm out of town.

seemsabitflashy
05-29-2002, 03:37 PM
Hey TG,

http://www.fiscalfitnesscenter.com/jamie/flash/userlogin_NEW4.html

It works the way I want it, but it still sticks "occasionally" on the "Unlocking Function". When it does, all you have to do is click the "Unlock button" and it continues properly. How can I get it to stop pausing? I hope you enjoyed your vacation! Did ya go some place warm? Well I hope you enjoyed it. Let me know if you can help. You've been awesome so far and really appreciate your help. I don't know if you freelance, but I might have some Actionscripting/Database work for you, I'm just waiting on a couple things. Talk to ya soon. By the way, why did you use the _root command?

Mike

tg
05-29-2002, 04:02 PM
seemsabitflashy, heh, sorry about not getting back to you. vacation didn't turn out quite the way i thought. wife spent the weekend in the hospital. so i've sort of let the computer stuff lag a bit... spent yesterday catching up, will probably keep doing that today. i did take a look at that the other day. how much of your source code has changed? if not too much, i will look at the code i have at home and see if i get any ideas. ill let you know. 8:00 am here now, so it will be awhile before i get there.

seemsabitflashy
05-30-2002, 09:44 PM
Hey TG,

Sorry to hear about your wife! Is she ok? I hope so! :) I was just curious if you had any luck with the flash? I'm not in a major rush, but my boss just wants to know by end of day Monday if, the flash will be flawless...we have a java scripting backup plan, but it would be cool to have the flash since its sooooo close to perfect. The code hasn't changed except I put a _root on the false return answer, so it would return the user for another try and the password. That's all..let me know if you figure it out...I'm still trying. Is it how the FLA file is setup in the timeline???? Maybe? Thanks again...Talk to ya soon.

Mike

tg
05-31-2002, 12:34 AM
ok, played around with it a bit. seems to do ok.
i havn't gotten stuck. so maybe it is working now. here is the file:

to answer your question from before (sorry... spaced it last time around).
i used _root on the goto action, cause teh action was being triggered on the 'unlock' mc in the data clip event. since the label you were referencing in the goto action was on the _root timeline, and not in the mc's timeline, i had to make sure i was telling the right object where to go.... does that make since? i kinda feel like im rambling.

wifes fine, thanks for asking. long standing problem that needs to be delt with every 4-5 years. just makes life that much more wacky without her around.

freelance: yes, i consider database stuff to be the 'fun stuff'. would be more than interested to hook up with you on some actionscript/db projects. email me any details. fyi. i pretty comfortable with actionscript (f5... working on mx), very comfortable with asp/vb, and play around a bit with coldfusion.
let me know.

hope this file works for ya. i will be around this evening (home) if you want to email me with any questions. (pacific time) however, i will be 'baggin' it around 10 pm.

seemsabitflashy
06-03-2002, 07:40 PM
Hey TG,

Well, I was hoping that this message was going to be a good one, but something weird happened to that file we worked on. Last Friday, the link I gave you was working perfectly, now it won't work. The flash won't communicate with the ASP page. Nothing has changed, no files were over written, no coding changes, what happened? I'm almost one 100 perscent sure that its SERVER SIDE. Our programmer says nothing was changed. There was a _VTI_CNF (I believe it has something to do with Frontpage Extensions on the web server?????) folder on the root level that wasn't there before the weekend), but our programmer says that that's just a log directory and shouldn't be causing problems. I'm no wiz at ASP or VB, but sense that folder wasn't there before and our Flash Login was working just fine before, I believe that it may have something to do with it. The page comes up fine, but it gets stuck in the "unlocking phase" or it just returns a "false" answer again.....Man am I frustrated! Have you ever heard of this problem? Works one minute...then the next...it doesn't.

Regardless...here's the link and the file....I added some animation to the file, but I never changed the coding from the file you sent me that worked perfectly on Friday! My problem is that we have a presentation this Friday June 7th and it has to work, because my boss saw the working product and is expecting it to work, when our client sees it. :( ...I hope you can help....you've been great so far. Thanks!

Oh one more thing....Our programmer, just started using Visual InterDEV over the weekend and he looked at the main folder of the site that this LOGIN is on. I belive that visual InterDEV created the _VTI_CNF folder. in my sub folder holding the login.

Mike

http://www.fiscalfitnesscenter.com/jamie/flash/userlogin_NEW5_2.html

tg
06-03-2002, 08:10 PM
i'll take a look at it sometime today. tell your programmer to get rid of visual interdev, and use dreamweaver mx. much better product. it will do everything visual interdev can do and a whole lot more.

tg
06-03-2002, 09:17 PM
codes working for me here. animation looks good.
got to be something on the server.

just to make sure, try the following( i would hate to blame the problem on someone else). delete your swf file from the server and republish your current file, then post up the swf. also, recheck all of your paths. make sure your swf is in fact reading a 'true' or 'false', and not a 'file not found' error... uncomment the getURL() action just before the loadvariables() action. publish and see what your get. is it returning true or false?