(Flash) Password Tutorial: Difference between revisions
(Created page with "===Password Tutorial=== ====Layout==== Here we'll create a layout for the password. Make sure that you have an idea in mind before reading on about this. Also, along with...") |
Whirled vox (talk | contribs) m (Text replacement - """ to """) |
||
| Line 9: | Line 9: | ||
*Add two text boxes. Add text in one saying | *Add two text boxes. Add text in one saying "Enter password", the other "Password Here". | ||
**Click on the | **Click on the "Enter" box and go to properties to set it as Readable Only. | ||
*** Set | *** Set "Password Here" as an Editable text box. | ||
****Give different instance names to both boxes. We will need this later. | ****Give different instance names to both boxes. We will need this later. | ||
| Line 19: | Line 19: | ||
====Coding==== | ====Coding==== | ||
This coding may vary on how you named the instances, so just change the | This coding may vary on how you named the instances, so just change the "buttonOne", "instanceOne", and "instanceTwo" to your assigned instances. | ||
'''YOU CAN GET A BASE THAT WILL HELP GREATLY IN YOUR PRODUCTION''' [http://www.mediafire.com/?r18p4nfh3zeiavp HERE] | '''YOU CAN GET A BASE THAT WILL HELP GREATLY IN YOUR PRODUCTION''' [http://www.mediafire.com/?r18p4nfh3zeiavp HERE] | ||
*Create a layer on top called | *Create a layer on top called "Actions", click on it's first frame, and open the coding window. | ||
**Below will be coding this is needed to be added. | **Below will be coding this is needed to be added. | ||
| Line 31: | Line 31: | ||
function functionOne (e:MouseEvent) void: { | function functionOne (e:MouseEvent) void: { | ||
{if (instanceOne.text == password) { | {if (instanceOne.text == password) { | ||
instanceTwo.text = | instanceTwo.text = "Correct!";} | ||
else {instanceTwo.text = | else {instanceTwo.text = "Wrong"}; }; | ||
'''HINTS:''' If you want to make the password take you to a certain frame add this right next to | '''HINTS:''' If you want to make the password take you to a certain frame add this right next to "Correct!"; | ||
gotoAndPlay(2); | gotoAndPlay(2); | ||
| Line 44: | Line 44: | ||
*Make sure that you change | *Make sure that you change "instanceOne" to the instance of your Editable text box. | ||
**Change | **Change "instanceTwo" to the instance of your Readable Only text box. | ||
***Try experimenting with the coding, but always keep a spare safe copy of the file! | ***Try experimenting with the coding, but always keep a spare safe copy of the file! | ||
****If you have any questions that can't be answered here, contact [http://www.whirled.com/#people-85600 Count] | ****If you have any questions that can't be answered here, contact [http://www.whirled.com/#people-85600 Count] | ||
Latest revision as of 12:18, 2 September 2018
Password Tutorial
Layout
Here we'll create a layout for the password. Make sure that you have an idea in mind before reading on about this. Also, along with the idea, have something that the Flash movie will go to if password is entered correctly.
- Add two text boxes. Add text in one saying "Enter password", the other "Password Here".
- Click on the "Enter" box and go to properties to set it as Readable Only.
- Set "Password Here" as an Editable text box.
- Give different instance names to both boxes. We will need this later.
- Set "Password Here" as an Editable text box.
- Click on the "Enter" box and go to properties to set it as Readable Only.
- Create a button and give it an instance name, too.
Coding
This coding may vary on how you named the instances, so just change the "buttonOne", "instanceOne", and "instanceTwo" to your assigned instances. YOU CAN GET A BASE THAT WILL HELP GREATLY IN YOUR PRODUCTION HERE
- Create a layer on top called "Actions", click on it's first frame, and open the coding window.
- Below will be coding this is needed to be added.
stop();
buttonOne.addEventListener (MouseEvent.CLICK, functionOne);
function functionOne (e:MouseEvent) void: {
{if (instanceOne.text == password) {
instanceTwo.text = "Correct!";}
else {instanceTwo.text = "Wrong"}; };
HINTS: If you want to make the password take you to a certain frame add this right next to "Correct!";
gotoAndPlay(2);
The number in parentheses is the frame number it will take it to.
Troubleshooting Help
- Make sure that you change "instanceOne" to the instance of your Editable text box.
- Change "instanceTwo" to the instance of your Readable Only text box.
- Try experimenting with the coding, but always keep a spare safe copy of the file!
- If you have any questions that can't be answered here, contact Count
- Try experimenting with the coding, but always keep a spare safe copy of the file!
- Change "instanceTwo" to the instance of your Readable Only text box.
Credits
If you decide to list an item in Whirled shop that was based off this Wiki, please credit me, Count L. Ronnacon. I want an attribution, but only if you used my base.