Which page switch gets priority?

I've played with switches and variables for awhile now. But I was wondering if the last page of an event with a single switch on takes priority?

What about this example, which takes priority?

Page 1: no switch conditions
Page 2: Self Switch A is on
Page 3: Switch "cat1" is on
Page 4: Switch "cat2" is on

Is the answer page 4?

Lastly, what about this example, which takes priority?

Page 1: no switch conditions (this event plays out and turns on self switch A to hide the event(
Page 2: Self Switch A is on
Page 3: Switch "dog" is on

Is the answer page 3? Thus meaning if I use self switch a but some event turns on a switch on page 3, will the page 3 switch take priority? Especially If page 2 is meant to hide an event but page 3 has a switch turned on.

I've wondered about these things. Would anyone mind please clarifying or let me know please? Thanks for reading!
The last event page takes priority, so long as the conditions are met. It doesn't matter what the conditions are.
all conditions have the same value.
highest page number is highest priority if all conditions are true
What Beregon said. An event will always consider its active page to be the highest-numbered one for which it meets the set conditions.
Example 1:
If cat2 is ON, then page 4.
If cat2 is OFF and cat1 is ON, page 3.
if cat1 and cat2 are OFF and self switch A is ON, then page2.
if NONE of the above 3 are ON, then page 1.

Same for example 2.
The latest page with a condition that has been met will run.
Thanks everyone for helping me clear that up! 😀 You guys are the best. ♥
I think that's what I sort of figured out as I was playing around with this and ended up having my first page on an event be the one with no conditions as that seemed to make things work smoother. I have a number of encounters where it wants to wait for certain conditions before it displays anything so the first page is just blank and no conditions and then I have the actual encounter on the second page where the condition for spawning is checked then self-switch A for the escape from battle on the third page then the 4th page will check for a switch to see if the encounter happened and will just show nothing again so that way the event never respawns.

Seems to be a great way to have a favorite enemy show up in one place then show up in another one saying something like "I told you I'd be back...."

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/which-page-switch-gets-priority.126564/