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:
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
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);
}
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:
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);
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.