A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: Login Script not working when exported

  1. #1
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193

    Question Login Script not working when exported

    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.


    Here is the AS on Frame 2:

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

    Code:
    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

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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?

  3. #3
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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...ple/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.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    problem

    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

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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");}
    }

  7. #7
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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.

  8. #8
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    Saw your code post. will try it.

  9. #9
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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
    Last edited by etuom; 03-25-2009 at 03:19 PM. Reason: added information

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.

  11. #11
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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

  12. #12
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    Quote Originally Posted by blanius View Post


    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.
    Last edited by etuom; 03-25-2009 at 04:01 PM.

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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");
    }
    Last edited by blanius; 03-25-2009 at 05:05 PM.

  14. #14
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    Quote Originally Posted by blanius View Post
    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:

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

  15. #15
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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";
    }

  16. #16
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    Still doesn't work. I just thought of something that may be helpful. I'll PM you with details
    Last edited by etuom; 03-26-2009 at 12:40 PM. Reason: typo

  17. #17
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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.

  18. #18
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    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

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

    Here is the AS on the button:

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center