Autorun cutscene at start of area

So I am trying to do this, where I have an Autorun event that causes my characters to walk on screen and then have a dialogue with each other. This works great, except that after I go into a building and come out again, my actors try to do the scene over but bug out when they try to auto-walk into the building they just came out of. I tried setting self switch A to on at the very end of the event, but that causes the event to not even happen in the first place. Anybody who can tell me how to sequence this event so that the cutscene only engages once?
The only way self switch A at the end of the event would cause it to not run at all is if you have your page priorities off. It should go like this:

Page 1: Run the cutscene, add self switch A at the end of it. Set page 1 to Autorun, so the scene runs when you first enter the map.

Page 2: Set it to run only if self switch A is on, make the event completely blank. Leave this page on the default of action button (so that it never runs, and is skipped).

That way, the cutscene is turned off after running once. Be advised this will run the very first time you enter the map, if that is not what you want you'll need to use more conditions on page 1 to prevent it from running until you want it to run.
The only way self switch A at the end of the event would cause it to not run at all is if you have your page priorities off. It should go like this:

Page 1: Run the cutscene, add self switch A at the end of it. Set page 1 to Autorun, so the scene runs when you first enter the map.

Page 2: Set it to run only if self switch A is on, make the event completely blank. Leave this page on the default of action button (so that it never runs, and is skipped).

That way, the cutscene is turned off after running once. Be advised this will run the very first time you enter the map, if that is not what you want you'll need to use more conditions on page 1 to prevent it from running until you want it to run.
Alright, thanks. Let me try that.

Edit: Yeah yeah yeah, now I understand more about events as well. Thanks for help!
maybe you can set switch B on a tile where u step into the building.

and the event conditions on the tile that starts the dialouge and walking event, you can add something like:

If : Switch B is on

 Exit Event Processing

        [ your dialouge and walking codes]

             Erase event

Original thread: https://forums.rpgmakerweb.com/threads/autorun-cutscene-at-start-of-area.49114/