Exactly what tulamide says <img src="smileys/smiley1.gif" border="0" align="middle" />
Clamp isn't nessessary. It's just "more clean" to me.
If I want to hold a number between a min/max value, then I use clamp.
clamp(value that needs to be clamped, min, max).
So, clamp(speed, 10,100) would mean, you allways have min. the speed 10, because if you go lower, the clamp give you anyway 10^^ Same with 100 if you go higher.
I used:
100 - clamp(distance(Sprite2.x, Sprite2.y, Sprite3.x, Sprite3.y)/4,0,100)
So it's a very simple example. The only thing you can tweak is the "/4" in this formula. Put it to a lower number, then your "chest" will appear a bit later. Putting a higher value than 4 wont' really affect it.
In Tulamides example, you have the full control about when it appears/disappears. It's just a little more complex.