Var.... and if

ok…
i got a button with this AS

[AS]
on (release) {
evento = “si”;
gotoAndPlay(777);
}
[/AS]

now…

that works…

but when i reach… frame 1428 i got another AS

[AS]
if (evento = “si”) {
gotoAndPlay(5794);
}

[/AS]

which is not working…

i think my problem is the IF :stuck_out_tongue:

help…

thanks!

They don’t use the same evento. They declare their own. Replace both by _root.evento and it should work.

[EDIT] And you have an error in your syntax. Should be [AS]if (_root.evento == “si”){something}[/AS] [/EDIT]

nop…


if (_root.evento = "si") {
	gotoAndPlay(5794);
}

not working…

:frowning:

See my edit :slight_smile:

thats it…

lil explain about the dif of = and == and ===

thanks :smiley:

= stores a value in a var, == checks for equality (is that a correct word ? :stuck_out_tongue: ) and === checks for strict equality ( the vars must match type )

also if the condition evento == “si” is false… it just goes to the next frame right?

Yep. If you don’t want it to continue if false you can use

[AS]
if (_root.evento == “si”){
gotoAndPlay(5794);
} else {
anthing you want here.
}
[/AS]

ok…

thankssss

np :slight_smile: