How to do stuff with the scenes using the "If(condition

How can I do something like:
If some guy presses a button in scene 1 and after that presses another button and goes to scene 2 then scene 2 appears but if he hadn’t pushed the button in scene 1 ,before he went to scene 2, then scene 2 wouldn’t have appeared

visit my homepage at

button 1:

&nbsp &nbsp &nbsp &nbsp _root.button1pressed=1;

the if statement:

&nbsp &nbsp &nbsp &nbsp …do this…
&nbsp &nbsp &nbsp &nbsp …do that…


…yes very…
thanx man…