swapDepth problem

Hi All,
In my script I can set depths by using

MC.swapDepths = (n);

This works ok when I use a number for n, but I want to set n by using a variable that is set randomly in the same code block - actually it sets the size of the MC. What I have is a bunch of MCs that move randomly in x and y and I am trying to simulate z movement by resizing the MCs. Obviously the smaller ones should be behind the bigger ones , but this doesn’t work:
mc1._x = random(500);
mc1._y = random(500);
perspective1 = random(500);
mc1._width =perspective1;
mc1._height = perspective1;
mc1.swapDepths = perspective1;

Width and height work ok, but not swapDepths. Any ideas?