• home
  • forum
  • my
  • kt
  • download
  • Easy password protection

    Author: 2008-10-02 13:47:14 From:

    Download .fla HERE
    -Click HERE to see the .swf
    (username: user password: pass)


    Make a New Flash Document,
    insert two keyframes, and place this code into both of them:

    stop();

    Now, select the first keyframe and
    make a input textfield, open the properties(F9), and do like this:

    Text Type : Input Text
    Text Font/Size/Color : Verdana / 10 / black
    Var : username
    Line Type : Singel line
    And select " show border around text"

    Make another:



    Text Type : Input Text
    Text Font/Size/Color : Verdana / 10 / black
    Var : pw Line Type : Password
    And select " show border around text"


    Now, make a dynamic text field and set the var. to "error" :



    Ok, now draw a button like this:

    Select it, press F8, choose button and name it submit.







    Goto frame two on the main stage and write something like "secret stuff",
    go back to frame one and select the button, now press F9 twice and paste this code into it:

    on(press){
    var msg:String = "Wrong password and/or username";
    if(_root.username == "user" && _root.pw == "pass"){

    gotoAndPlay(2);
    }
    else{
    output =(msg);
    }
    }


    Now your username is "user" and your password is "pass",
    press Ctrl+Enter to test! =D

    You can also create a button to clear all text fields,
    just paste this code into it:

    on(release){
    _root.output = "";
    _root.pw = "";
    _root.usern = "";
    }

    That's all! Enjoy your password protection! =D
    Remember that this is NOT very safe! so don't use it to protect important stuff!


    UPDATE!

    If you right-click and select play, you will go to nextframe(the "protected" one), to remove this menu:

    Open your .fla, go to File>Publish Settings, select the HTML tab and
    deselect "display menu".
    Now, press publish and you will get a html file in the save directory.
    Open this and the menu are gone ;)

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (25)
      Tricks (6)
      Games (66)
      Utilities (20)
      Getting Started (91)
      Video (24)
      Interactivity (43)
      Web Design (29)

    New

    Hot