@AnD4D: yes, as the capx is setted up it's normal.
Let's "translate" your code :
Every tick, when Sprite2 is overlaping sprite, we set sprite2 width to sprite2's current width -1. Same for height.
As long as sprite2 is overlapping sprite, it will shrink.How events work