sorry i 've answered but the way scirra disconnect users from this forum is very frustrating because we always loose all text we have written !
So again considering "player" is the player sprite ...
1?) in the layer select the player sprite (left click) and (then right click) -> Z-order move to top of layer ...
2?) in code "player : move to top of layer"
You should have to use 2?) if the tree is a object create by code in this layer or move to this layer using code because doing that it is always display in front of all others existing objects in this layer.