Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Protection 1

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
US
Is there a way to password protect a scene of a movie?

And if the wrong password is entered the user is sent to the scene where they started?
 
sure:

Have the first frame of the scene have a text field and submit button... name the text field... on(release) the button to go to frame two... in frame two check the textfield variable:

if (_root.textfield == "Right") {
gotoAndPlay(3);
} else {
gotoAndPlay("Wrong",1);
}

[conehead]
 
I used the following code.

if (_root.textfield == "Right") {
gotoAndPlay("student",1);
} else {
gotoAndPlay("home",265);
}

the name of the text box is textfield.

My question is, "What is the password? Is it checking is the user entered the word "Right" in textfield?

Currently it sends the user to scene: home, frame: 265, regardless of what is entered in textfield.

I want it to send the user to scene: student, frame: 1, when "portfolio" is entered in textfield and the button is clicked.
 
Yes... Right would be the password so change that to whatever you want... make sure _root.textfield is the right path to the text box also should probably be _root.textfield.text

[conehead]
 
That is what I have but even when I enter the correct password it sends me to:scene: home, frame: 265.

I think the path is right/
The textbox is in scene: home frame: 275 and the code to check is in scene: home frame: 276
According to my understanding if I enter "port" I should be sent to scene:student frame:1

-----------------------------------------
The code to check is as follows:
if (_root.textfield.text == "port") {
gotoAndPlay("student",1);
} else {
gotoAndPlay("home",265);
}
 
That didn't work!?

if (_root.passing == "port") {
gotoAndPlay("student",1);
} else {
gotoAndPlay("home",265);
}
I am using a Input box named "passing".
A button symbol that I created
The password is, "port"
The code is below:


if (_root.passing == "port") {
gotoAndPlay("student",1);
} else {
gotoAndPlay("home",265);
}

What else could be wrong??
 
ok I have tried it an dit works fine... if you have the text box's instance name being "passing" then you need to use _root.passing.text if you have made its var passing then just use _root.passing

put this code one your submit button and make the instance name of the text box passing and take off any var name and make sure you have stops somewhere in the scenes they are going to:

on (release) {
if (_root.passing.text == "port") {
gotoAndPlay("student",1);
} else {
gotoAndPlay("home",265);
}
}

[conehead]
 
It worked when I placed the code in the button action.

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top