A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: User login problem

  1. #1
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663

    User login problem

    Hi,, I have a problem here,, I have a login and password box set in dynamic text and I want it to select (loadmovie) on password correct and to another (loadmovie) if the password is wrong. The problem is that I can't get the two text boxes to link with the (ok) "enter" button. Any AS or PHP,CGI scripts would be welcome. It's driving me nuts. I just can't get the thing to read both boxes and refer to the cgi for confirmation.
    Cheers.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  2. #2
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    The main idea is to wait for the result generated by the PHP,CGI,etc script.
    So ...
    You have two dynamic text boxes (called for example "user" and "pasw") and that button.
    The script for that button should look like:
    this.loadVariables("kickuser.php?user="+user+"&pas w="+pasw+"&","POST");

    The active script (PHP in this case) must be able to send the "pass" result.
    In case of valid username and the password : echo "pass=YES";
    Otherwise: echo "pass=NO";

    Now inside of the SWF file:
    For the keyframe containing the dynamic text boxes and that button, set this script:

    pass = "";
    check = 1;
    onEnterFrame = function(){
    if (check == 1){
    if (pass == "NO"){check=0;holder.loadMovie("go home young fellow.swf");}
    else if (pass == "YES"){check=0;holder.loadMovie("come to mamma.swf");}
    }
    }
    stop();

    Of course, you may improve many things there.
    Last edited by necromanthus; 03-31-2005 at 03:39 AM.

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