Since it's my demo, I'll explain.
Please download this updated file:
dropbox.com/s/jhje5xdqc5t2ahw/Forest2.capx
Note, that all sprites have origin image point at the bottom.
First, in event #1 all trees are z-sorted by their Y-position on the layout.
On every tick I pick trees that are below the character on the layout. These trees will be green, all trees above will become grayscale.
Then among the green trees I pick the bottom tree (on Z-axis). I may as well pick a tree with lowest Y-coordinate, it will be the same tree. This tree will start pulsating.
And finally I move the character behind this tree.