Insert an 'evaluate' action(Esc+ev) and type in mess="Invalid password!". When you type the wrong password or you don't type anything you will be alerted that it's an invalid password.
Insert another 'if' action and type in password=="tutorial" - now the password for the username "flashkit" is "tutorial"..
I guess you've noticed that we need to insert another 'evaluate' action. So press 'Esc+ev' and type in mess="You forgot your username!". When you type a wrong username or when you don't type a username you'll be alerted that you forgot your username.
For the end we must insert another 'if' action. Press 'Esc+if' then type in the text field the following: username=="flashkit" & password=="tutorial" then insert an 'evaluate' action and write in mess="Welcome " + username. By doing this the text typed in the variable 'username' is loaded in the variable 'mess'. If you want another final action, maybe a 'getURL'(Esc+gu) action, you must insert a 'getURL'(Esc+gu) action where you type the url and the target(' _self' specifies the current frame in the current window; '_blank' specifies a new window; '_parent' specifies the parent of the current frame; '_top' specifies the top-level frame in the current window.) but also the variable used(POST or GET).
Here is the code:
on (release, keyPress "") { mess="Sign in please!"; if (username=="flashkit" ) { mess="Invalid password!!"; } if (password=="tutorial") { mess="You forgot the username!"; } if (username=="flashkit" & password=="tutorial") { mess="Welcome " + username; } }
on (release, keyPress "") { mess="Sign in please!"; if (username=="flashkit" or username=="vlad") { mess="Invalid password!!"; } if (password=="tutorial" or password=="romania") { mess="You forgot the username!"; } if (username=="flashkit" & password=="tutorial" or username=="vlad" & password=="romania") { mess="Welcome " + username; } }
We used the 'or' action. - condition1 'or'condition2
| » Level Intermediate |
|
Added: 2002-09-21 Rating: 7.91 Votes: 175 |
| » Author |
| I'm a 17 year old boy who has spent the last 2 years animating in Flash. I live in Romania, i design web pages and i love to surf on the internet. |
| » Download |
| Download the files used in this tutorial. |
| Download (126 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!