Help - 3D Rotating Gallery - So close!

Hi all,

Here my attempt at creating the Kirupa’s Spinning Images gallery. Grrr… I’m so ■■■■ close it somewhat works, I’m still having trouble with the rotational calculations. Can some please advise? Not sure, but I think I might be passing the wrong values from the onRelease to the enterFrame loop? Any comments or suggestions are always greatly appreciated, thanks.

//
var world:Array = [];
var rotate = 0;
var fl = 1000;
var clip;
//
function spin()
{
for(var i = 0; i < world.length; i++)
{
var w = world*;
rotate += (clip._x) / 4000;// WRONG VALUE?

var angle = w.angle - rotate;
var x = Math.cos(angle) * w.radius;
var y = w.y;
var z = Math.sin(angle) * w.radius;
//
var scale = fl / (fl + z);
w._x = x * scale;
w._y = y * scale;
w._xscale = w._yscale = 100 * scale;
w.swapDepths(Math.ceil(-z));
}
}
//
var thumbsAmt = 4;
var thumbCount = 0;
var step = (2 * Math.PI) / thumbsAmt;
var loadThumbs = function()
{
var th = ‘th’ + thumbCount;
var w = worldMc.attachMovie(‘thumb’, th, thumbCount);
w.radius = 200;
w.angle = step * thumbCount;
w.x = Math.cos(w.angle) * w.radius;
w.y = 100;
w.z = Math.sin(w.angle) * w.radius;
w.onRelease = function()
{
rotate = this.angle; // WRONG VALUE?
clip = this;
};
w.tf.text = thumbCount;
//
world.push(w);
thumbCount++;
//
if(thumbCount == thumbsAmt)
{
clearInterval(thumbsInterval);
clip = worldMc.th0;
worldMc.onEnterFrame = spin;
}
};
//
var thumbsInterval = setInterval(loadThumbs, 0);