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 www.hot.ee/syko

button 1:

on(release){
&nbsp &nbsp &nbsp &nbsp _root.button1pressed=1;
}

the if statement:

if(_root.button1pressed){
&nbsp &nbsp &nbsp &nbsp …do this…
}else{
&nbsp &nbsp &nbsp &nbsp …do that…
}

sensical?

…yes very…
thanx man…