PDA

View Full Version : password?


Xansi
10-22-2002, 05:13 PM
Hi everybody, this is my problem, hope anyone could help:
I have a "password" scene wich sends you to the "main" scene with a button, wich have this script:

on (release) {
if (password eq "netze") {
gotoAndPlay("Main", 1);
} else if (password eq "sun") {
getURL("http://www.sun.com", "_blank");
} else {
gotoAndStop("error");
}
}

So, when you click the button nothing happens, only if you write wrong the password (the playhead goes to the "error" frame).
(Yes, I have followed the "Password protected pages" tutorial).
Anyone knows why this happens? :confused:

toxalot
10-22-2002, 05:24 PM
I don't see anything wrong with this code. Where is the variable password getting set?

I'd say that password doesn't have the value you are expecting. Try adding

trace(password);

as the first line after

on(release) {

so you can see what value password really does have.

Jennifer

Xansi
10-22-2002, 05:38 PM
thanks for your answer
the variable "password" it's assigned to the dynamic text field in wich you write the password
If this is correct, and if the script is correct too, where is the problem?
I can't see it, :confused: please help me.

-Xansi

toxalot
10-22-2002, 05:41 PM
Did you try adding the trace?

You need to confirm that the variable you are testing really has the value you are expecting.

Can you post a sample fla?

Jennifer

Xansi
10-22-2002, 05:48 PM
thank you again
I've added the trace, it says "password" in the output window, this what it must say?
Here is the fla (it's in spanish):




Any idea?

-Xansi

toxalot
10-22-2002, 06:00 PM
I've added the trace, it says "password" in the output window, this what it must say? Not unless you typed password into your box.

Did you use quotes around the word password in your trace?

Did you write
trace(password);

or

trace("password");

The second one would of course give you exactly what is in the quotes in your output window.

The first one should give you the value of password in your output window.

You didn't upload the fla.

Jennifer

Xansi
10-22-2002, 06:01 PM
Sorry, here is the zip:

toxalot
10-22-2002, 06:51 PM
I've isolated the problem, but haven't found the fix (well sorta).

If I remove the password field and button from the mc and put them as their own elements on the stage, then it works. So it seems to be a path issue.

From inside the password mc, it doesn't know what/where 'Main' is.

And anyway, scenes are usually not recommended. Try putting every thing all in one scene and just use named frames.

The other thing, you shouldn't use password as a variable as it is a reserved word. Name it something else.


Jennifer

Xansi
10-22-2002, 06:58 PM
Maybe I need to do again the fla :(
Anyway, thanks for your time & your recomendations. :D

-Xansi