How to put a Password on a Button?

I have a site up, And im working on a private tactic movie that i only want a few people to have access too. So , i was thinking to have this link secure some how. The only way to enter it would be to click through the button. Once you click the button, it will ask you for a password . When you enter the password it will send you to the movie link.

So adding a password to a link is one thing i need to know how to do. Also, once the person reaches that link. I dont want it to show the url . So if they copy past the url from the box in explorer and put it in again the movie will play. I only want it to be able to go through the button with the pw, it should not show where its actually located on the host directory…

If anyone could tell me how to do this i would be in great debt. A tutorial would be good also. I just cant find anything on passwords…

I know flashMX can set a textarea as a password, so only “stars” are shown… but I’ve never tried making sites NOT show the directory in which they are…

maybe this’d make a nice little tut! :stuck_out_tongue:

“Securing your site”… More or less…

if you use loadMovie, rather than opening a new window, the user won’t be able to see which movie you’ve loaded. that movie will end up in their browser’s cache however.

one technque eyez (i think) mentioned is naming your movie something other than .swf since flash doesn’t really care what the name is.

use an input field for the password box, you can check the “password” option to make the text appear as *'s.

on the button check the contents of the password field, if it matches, load the movie, otherwise display a bad password message.

unless you use server side verification over ssl, this is about as secure as an enron investment, but will dissuade most people.

anyone who decontructs you’re swf will be able to read the password.

if you’re interested, you could look at encrypting it in your movie. without the serverside verification, this is still very little security, but it’d be another layer. there’s a SHA1 secure hash all in flash courtesy of the ever impressive [url=]branden hall and [url=]paul andrew johnston.

all a matter of just how secure you want it to be

Here’s a simple way - like sbeener said - it depends on the level of security you want.

The password is password.

One jumps to a diff frame, the other loads a movie - it will do for basic authentication.

Just don’t try and protect nuclear weapon blueprints with this

Test the movie in your browser - CTRL + F12.

Ill try it out. Only thing is . I always run into problems when i download an fla or get an explanation on how to do something. It never seems to work out with what im trying to do. But if i follow the tutorial it works, unless i try to edit it to work with my movie. Like just today i was trying to do a preloader. And have a graphical thing play while the loader was going.

I hope i can figure it out, but i doubt it =(.

If you guys can be a bit more specific or give me a step by step instruction to put the pw up. and then how to load the movie to the pw button and have it open as a movie clip or something instead of a url. That would be great :slight_smile:

Your password thing is pretty simple and works.

I was just wondering. IS there anyway to do it. So that they just type it in and hit enter. Or have the button as the text box also. im not sure what to do with that. I was thinking to have a login menu. When they type in pw and click enter it can take them to the link / movie. Or have a button names enter. just dont have much room to put it on same line in my border on site


on (release) {


on (release, keyPress "<Enter>") {

When i used your fla and published it , it worked fine. Then i even edited your actionscript and made it point to a movie i had already made. And it loaded the movie and worked fine. When i tried to make the password and make my own button on my page it didnt work. As usual everything works great until i try it on my own thing. I created a button gave it the same exact action script. made a text box with border / input text and password options.

Even made it the same font and color you did just to make sure everything was exact. It didnt work. Then i found another action script on your top layer for stop and pass = “” so i added that to my top layer also. not a new layer just to an existing top layer. Ofcourse when i publish the movie again and put the password in. It does nothing. Only thing i can think of is the extra frames you have in there. Do i need those ? what are they for ? and why does your button have so many frames and layers. Is it using some type of hidden script to link to the password ?

Any added help you can provide would be great.

Post your fla. if you can and I’ll look at it - just use the concept of the actionscript in my example - I put two examples so some of the script would be irrelevent - you need to grasp why it’s doing what it does.

Make sure you have the correct targets in the button, and have the pass variable correct.

It’s quicker if you post your fla. I’ll change it and then comment the changes in the fla.

I left the action script like you had it. Same Variable name, same movie target. I dont have access to the webhost so i have nowhere to load up the fla. unless i use geocities or something.

I understood the concept. The script wasnt hard to understand. It could be because of the layers your pointing them too ? I really dont know. Ill see if i can load the fla to an old site i had.

Here is the .Fla . Thanks again for all your help

Oh and i know i dont need the pass = “” on the first layer. But it didnt work with out that either. It doesnt really effect anything. I dont think atleast.

Email it to me at olives at I’m putting at - but you’ll have to use @ - because of those spam robots - thanks Eyezberg for reminding me.

Or post it here.

I had 2 layers - the firs I use normally, seperately for stops, just makes things neater, and I also put in there pass = “”, so when it returns that point (Enter password bit) it resets the password to nothing “”.

And the other layer just has the text boxes buttons and frame labels.

You could essentially do what you want in one frame and layer.

I’m checking the fla now. (Just got it as I was typing this).

I’ve changed your fla. One of the problems was your button. I had to redo it.

When you click ok or press enter with the right password - axiswake.swf will be loaded into level 1. I presume this is what you want as that’s what’s in the code.

Let me know how you get on or if you don’t understand anything.

You not around, so just email me at the above address or send me a private message with your email address and I’ll email it to you - or I’ll put it up on my site and you can download it.

I checked your button. It had no actionscripts. Plus later on i am going to add rollovers to my button. What needs to be changed in the button to make it link to the movie ?

When you say you checked it - you mean your fla that I modified? How did you download it - I had it on the web for a only a short while then I took it off.

I’ve put the link in a private message for you. Check you private messages.

The button you sent me the first time with the password . and the actionscript. Your button was its own movie clip it had different layers and such but it didnt have any code to it. So why would your button work and mine wont ?

I think I know now what you mean about the button having layers on it. I just pulled a button from the flash library - instead of making my own because I was demonstrating, and that button is built by seperate layers. Don’t worry about what’s in the button, just click on the button itself and press F9 to bring up the actions window - you’ll see the actions in there. Any way did you check your fla?

It works fine. I was just wondering if you knew how to make the movie load in a seperate window. I also wish i knew what you changed with the button to make it work cause the actionscript is the same exact code as one i put.

You seem to know your stuff though. Thanks again. :slight_smile:

You’re welcome. Glad it worked. There is the obvious way of having a javascript window open with the new swf, or you could have an mc on top of everything on the stage, even one created dynamically, and load the new swf into there.

I’ll try and do a fla if I get the opportunity.