;

PDA

Click to See Complete Forum and Search --> : v7-AS3 Login Script not working when exported


etuom
03-25-2009, 02:15 PM
Hi all!

I am trying to get an older login script that DickN1943 got help with a few years back. I copied the old page it was used on and redid the look but kept the code. It works as it should in the browser preview but does not when exported as swf/html. I have tried it both locally and on the server. I am using V7 but exporting to Flash8 AS1. :confused:


Here is the AS on Frame 2:

user = "";
users = "";
finduser = function(){
seluser = "";
for(i=1;i<4;i++){
if(user == user){seluser = user;}
}
}
Here is the AS on the button:

on(press){finduser();}
on(release){
if(seluser != ""){getURL("projects/"+seluser+"/index.html");}
}



The "user" is a dynamic text box. I don't know if any of that helps but thought I'd put it in anyway. Any ideas why it won't work when exported and how to fix?

Thanks for any insight you can provide

Still a newbie
Eric

blanius
03-25-2009, 03:09 PM
if(user == user){seluser = user;}

This will always evaluate as TRUE user will always equal user

I'm just guessing the users is supposed to be any array and you want to compare that

if (user==user[i]{seluser=user;}

Not sure I see the point of any of this however, what exactly are you trying to do here?

etuom
03-25-2009, 03:39 PM
This a login that clients can type in thier password, click the button and open thier own personlized pages. See here at test site http://www.heritagecustomwoodworking.com/index4.html

If you type in "Sample" (no quotes-case sensitive-its a password" you should get this:http://www.heritagecustomwoodworking.com/projects/Sample/index.html
which is a Sample of what the page would look like.

I notice that when you use the login page you get "undefined in the address bar.

I am changing the site DickN1943 designed for us (he passed away so I can't ask him)and am trying to integrate this Client Login feature into the site.

blanius
03-25-2009, 03:56 PM
Ok that is a bit of a problem, especially without seeing the whole thing.

Where are the user passwords stored? and I assume the password is the directory name as you show

blanius
03-25-2009, 03:59 PM
If it works locally it might be there is a file with the users in it that needs to be uploaded.
It's really hard to say with the information you've provided.

blanius
03-25-2009, 04:01 PM
IF the password is always the folder name you could make this alot easier.

//on(press){finduser();}// delete this

on(release){
if (user != ""){getURL("projects/"+user+"/index.html");}
}

etuom
03-25-2009, 04:06 PM
The user password is nothing more than the folder name in which the clients page is in. These folders are all in the projects folder which is in the same directory in which the main site resides. So the input in the text box looks for the project folder and then the client folder (in this case Sample) and opens the index.html within that folder.

In other words this projects folder has numerous sub folders in it each named after the client. If you typed in "Lanius" it would open the index.html at projects/Lanius/index.html and you would see the plans for your $50,000 kitchen:)

There is no file that has passwords stored in it.

etuom
03-25-2009, 04:12 PM
Saw your code post. will try it.

etuom
03-25-2009, 04:18 PM
Yes, the password is always the folder name. But... the code you suggested did not work in the preview or when exported.

All the required files are in the right spots both locally and on the server. Neither works

blanius
03-25-2009, 04:28 PM
on(release){
if (user != ""){getURL("projects/"+user.text+"/index.html");}
}

That should do it. You do realize this is not a secure setup... Probably not a big deal but you should be aware. Also a bit clumsy as it's prone to mistakes and worst of all if the user hits enter it will mess up.

etuom
03-25-2009, 04:37 PM
No that didn't work. Doesn't the AS on the timeline have to jive with the AS on the button? See 1st post above

etuom
03-25-2009, 04:57 PM
You do realize this is not a secure setup... Probably not a big deal but you should be aware. Also a bit clumsy as it's prone to mistakes and worst of all if the user hits enter it will mess up.

Yes I know. I never liked it from the get go but it worked and was easy to understand howbeit clumsy and labor intensive when updating pages. What I would REALLY like to have is a login you can hit enter with and that will reference a template of some sort and the password would indicate the appropriate information (Text, JPEG,s and PDF's) to display. Right now I have to reproduce the client page and personalize it for each customer.

blanius
03-25-2009, 06:01 PM
what you want to do is very doable.

The code should work if the textfield is called user.
The button Code can stand alone from the timeline.
try testing the button click by adding another text field call it debug and try:
Oh and Forgot to change the first user to user.text
on(release){
if (user.text != ""){getURL("projects/"+user.text+"/index.html");}
debug.text="projects/"+user.text+"/index.html");
}

etuom
03-25-2009, 06:38 PM
what you want to do is very doable.

The code should work if the textfield is called user.
The button Code can stand alone from the timeline.
try testing the button click by adding another text field call it debug and try:
Oh and Forgot to change the first user to user.text
on(release){
if (user.text != ""){getURL("projects/"+user.text+"/index.html");}
debug.text="projects/"+user.text+"/index.html");
}

Tried that. No luck. added a "(" before "projects/..." to get it accept the syntax thus it would look like this:

on(release){
if (user.text != ""){getURL("projects/"+user.text+"/index.html");}
debug.text=("projects/"+user.text+"/index.html");
}

blanius
03-26-2009, 01:12 PM
Sorry dude my line was not quite right
on(release){
if (user.text != ""){getURL("projects/"+user.text+"/index.html");}
debug.text="projects/"+user.text+"/index.html";
}

etuom
03-26-2009, 01:39 PM
Still doesn't work. I just thought of something that may be helpful. I'll PM you with details

etuom
03-27-2009, 12:32 AM
Have been running some test to narrow things down.

The login script as originally produced is exported in Flash 6, works fine all the way through preview, Internet Explorer and Firefox.

When this same script is placed on a newer page it requires Flash 8 , works in the preview, does not work in Internet Explorer but it does work as it is suppose to in Firefox. So the issue seems to be between Flash 8 and IE. Any ideas why this might be? Version is IE7.

etuom
03-27-2009, 01:09 PM
I took the same file that worked and which was exported with Flash 6 and re-exported as Flash 8 as my new file requires and it didn't work. Seems this code is obsolete and not compatible with Flash 8. Can anyone confirm this?


Again, this is for a Dynamic Text Box and a button.

Here is the AS on the Timeline for the box

user = "";
users = "";
finduser = function(){
seluser = "";
for(i=1;i<4;i++){
if(user == user){seluser = user;}
}
}


Here is the AS on the button:

on(press){finduser();}
on(release){
if(seluser != ""){getURL("projects/"+seluser+"/index.html");}
}