It's referred to as "depth sorting" or "z ordering".
A common way to do it would be to put all the object you want to sort into a family and use this event to sort:
System: for each family1 ordered by family1.y
--- family1: send to top
It works best if the object hotspots are on the bottom. You can also do it without families by using one object and having different animation frames represent the different objects.