Problem with an animated event

Hello. I'm trying to create an event where you can move out a curtain to see what's behind it.(by showing a picture)
My problem is when you leave the room without triggering the second event,it doesnt reset,causing the second event to appear right away without the first one.
How can i make all of it to reset when re-entering?
are you resetting switch 01 at the transfer out of room?
are you resetting switch 01 at the transfer out of room?
No,and do you mean resetting by turning off?
it's not resetting because you're using self-switches, and those can't be accessed from outside the events.
try controlling the change through the global switch, so you can reset that through the transfer and IT will reset the event.
if you set page 2 to run under a global switch, it should work all the same.
To add to the suggestion above:
Technically, you can access self-switches from the outside using the "script-call":

$gameSelfSwitches.setValue([X,Y,'Z'], P);

X = Map ID
Y = Event ID
Z = Which self-switch is controlled (replace with 'A' , 'B' , 'C' or 'D')
P = replace P with true if the switch should be switched on or false if the switch should be switched off.

So if you feel confident using script calls you could still do this with self-switches, otherwise you probably want to use @gstv87 's approach, which is more beginner friendly.
it's not resetting because you're using self-switches, and those can't be accessed from outside the events.
try controlling the change through the global switch, so you can reset that through the transfer and IT will reset the event.
if you set page 2 to run under a global switch, it should work all the same.
Thank you

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-an-animated-event.133069/