Camera Rotation

I’m trying to make a camera view rotation as if you’re standing in the middle of a circle which rotates around you. I have the rotation and movement down thanks to a tutorial here on Kirupa but the code I’ve added to duplicate the images in the circle doesn’t seem to give me more than 10 different clips.


this.createEmptyMovieClip("theScene", 1);
theScene._x = 375;
theScene._y = 150;
var param_interval = setInterval(checkParamsLoaded, 100);
objectsInScene = new Array();
cameraView = new Object();
cameraView.rotation = 0;
focalLength = 900;
displayFriend = function () {
    var angle = this.angle-cameraView.rotation;
    var x = Math.cos(angle)*this.radius;
    var z = Math.sin(angle)*this.radius;
    var y = this.y;
    if (z>0) {
        if (!this._visible) {
            this._visible = true;
        }
        var scaleRatio = focalLength/(focalLength+z);
        this._x = x*scaleRatio;
        this._y = y*scaleRatio;
        this._xscale = this._yscale=100*scaleRatio;
    } else {
        this._visible = false;
    }
};
angleStep = 2*Math.PI/10;
for (i=0; i<=_root.crowdSize; i++) {
    trace(i);
    attachedObj = theScene.createEmptyMovieClip("friend"+i, i);
    friendPath = "theScene.friend"+i;
    eval(friendPath).createEmptyMovieClip("profile"+i, i);
    friendProfilePath = "theScene.friend"+i+".profile"+i;
    eval(friendProfilePath).loadMovie("im/p"+i+".jpg");
    attachedObj.angle = angleStep*i;
    attachedObj.radius = 450;
    attachedObj.x = Math.cos(attachedObj.angle)*attachedObj.radius;
    attachedObj.z = Math.sin(attachedObj.angle)*attachedObj.radius;
    attachedObj.y = 0;
    attachedObj.display = displayFriend;
    objectsInScene.push(attachedObj);
    trace(attachedObj);
}
panCamera = function () {
    if (Key.isDown(Key.LEFT)) {
        cameraView.rotation += .1;
    }
    if (Key.isDown(Key.RIGHT)) {
        cameraView.rotation -= .1;
    }
    for (var i = 0; i<=objectsInScene.length; i++) {
        objectsInScene*.display();
    }
};
theScene.onEnterFrame = panCamera;
stop();

The code I added to the above script creates a movieclip called friend, then creates a movieclip inside of friend called profile, and loads the individual images into the profile clips (the friend clip is then positioned by the code that does the camera rotation).

There is nothing in the library and the 21 images (0-20) are being loaded in a relative folder (im/p#.jpg). The crowdSize variable comes from a text file that has psize=21. In the scene before the one containing this code I wrote the following:


pcrowd = new LoadVars();
pcrowd.load("pcrowd.txt");
pcrowd.onLoad = function() {
    _root.crowdSize = pcrowd.psize;
    play();
};
stop();

PS: My .fla has Flash 6 export settings and Actionscript 1.0.

Any help is appreciated!