Zooming Figures modification

I’ve tweaked Kirupa’s 3D zooming figures script but there’s one more thing I want to customize it with but cannot figure out how to do it.

Basically I want to execute a command (goto another scene and stop the script) when one of the movieclips (call it figureC) reaches a certain point on the z axis.

Is it a case of adding another if clause at the top of the chunk of code below?

if (this.z > 5500){
this.z = 5500;
this.dir = -1;
else if (this.z < -300){
this.z = -300;
this.dir = 0;