Projects

Overview
Flash: External Password

Please note that this tutorial assumes that you have a working knowledge of flash.

 
   
  (Above image) Select the rectangle tool, and make sure that you are paining with no line. you'll want to choose a neutral color like yellow then red, and green. Paint the stage with these vectors one in three different frames. Yellow is when you first come upon the page, you'll be directed to the frame with red background when you get the password wrong, and the green frame will be where your protected data is stored.  
   
  So make three layers. Where the colors were painted is called 'background', the layer that contains the text box and buttons is called 'password' and on top of that is the 'actions' layer. Now name the second and third frames, the red one 'wrong' and the green one 'right'.  
   
  Take the text tool and make a text box, then make sure that it has these properties. 1. make it an 'Input Text' box. 2. Give it an instance name which I called 'thePassword', and it is case sensitive. 3. make the type of text to be 'Password'. This will cause the characters in the text field to be hinden by astrics as you type.
You can use any buttons for the submit and back button, or you can create your own.
 
   
  Now it's time to state assigning the actions scripts. We'll start with buttons. For the submit button add the action script in the picture on both frames, and the same with the 'back' button.  
 
 
 

Go to the frames in the actions layer and enter the script as seen above, then create an external txt file named password.txt which will contain your password.


What is happening here is this; in the first frame, var externalVars = new LoadVars(); is saying load a new extneral value.
The next line, externalVars.onLoad = function() { secretcode = this.content; } is telling flash how use the loaded file in the movie. In this case it's saying that the conent of the txt file loaded will be the secretcode. So when assigned the 'if' to the submit buttion it's saying that if the content if the instance name of the text box is equal to the loaded text file that now has the instance name 'secretcode', then go the protected content.
So you can also go in the submit button and change the 'gotoAndStop("right"); ' code to ' getURL("http://..."); ' and that will make the web link the secured content.

 
     
 

Add comment


Security code
Refresh

Joomla Tutorial by JoomlaShack