Once you have written your code, make sure you are in Play mode and out of Bird’s Eye mode so that you can control the player to walk onto and off the button. Your button should push down (or do whatever your second animation frame does) when you step on it, and then pop back up when you step off of it.
If your button is flashing, that’s still great! Both events are being detected and trigger the animation code. The problem is that the default Collider, VOXELOBJECT is complicated, and being near an edge of it can make it seem like you are moving in and out of collision very quickly. To fix this, all you need to do is to change the Collider to BOX, and it should start only changing when you expect it to.