This is gonna be jumbled as its my first tutorial...
Okay...Open a new FlashMX movie.
Create the layer wrong.
Now...I used this for a WebDesign site so people could log in and see their site progress...if thats what your doing, then make a layer for each client. (john doe, jack whack, etc, etc).
[ here I have the 'wrong' layer - the 'WJ' layer (a client) and the 'Layer 1' which will soon have the username/password and login stuff ]
Create an 'Input Text' single line with the variable 'un' (for username - without the ') on the 'Layer 1' layer.
Create a second 'Input Text' with 'Password' selected from the 'Line Type'. Make the variable 'pw' (for password - again without the ') also on the 'Layer 1' layer.
Now make a button and put 'login' or something on it.
Now on the 'Wrong' layer, at the fifth keyframe, press F6 and label it 'wrongpass'. Put some text like 'Ooops - wrong password' or something... Now on the 25th keyframe press F6 again and put this actionscript in:
gotoAndStop(1);
Now the 'Wrong' layer is done.
Now onto the 'WJ' layer...(or whatever yours is) (remember to label it...) On the 35th keyframe press F6 and put whatever content you want to be there...and put this actionscript on that keyframe also:
stop();
Now head back to 'Layer 1' and right click the button you made....put the following actionscript into it:
on (release) {
if (pw == "hey" && un == "wj") {
gotoAndStop("wj");
} else {
gotoAndPlay("wrongpass");
}
}
Now, to explain the mother.
on (release) {
if (pw == "hey" && un == "wj") {
gotoAndStop("wj");
} else {
gotoAndPlay("wrongpass");
}
}
is pretty much saying 'if the password box has the text 'hey' in it and the username box has 'wj' in it then go to and stop at 'wj' which is where WJ's content will be - or else (if the username and/or password aren't correct, go to and play the label wrongpass.
The reason it's 'play' is because we made the wrongpass have quite a few keyframes, this way it says 'Oops - wrong password' for about 5 seconds then heads back to the username/password prompt...
I think thats it...I'm sure I've missed something, but hopefully this helps...
| » Level Basic |
|
Added: 2002-06-11 Rating: 5.07 Votes: 69 |
| » Author |
| Gregory Yuzik AKA Wicked Jester - 15... |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!