# Rotating Images from camera panning tutorial

**URL:** <https://forum.kirupa.com/t/rotating-images-from-camera-panning-tutorial/237534>\
**Category:** flash\
**Created:** [August 31, 2007, 4:21am UTC](https://forum.kirupa.com/t/rotating-images-from-camera-panning-tutorial/237534 "2007-08-31T04:21:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottG](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@ScottG](https://forum.kirupa.com/u/ScottG)\
**Post date:** [August 31, 2007, 4:21am UTC](https://forum.kirupa.com/t/rotating-images-from-camera-panning-tutorial/237534/1 "2007-08-31T04:21:19Z")

</div>

Hi all, I used the tutorial from this site about camera panning to create a ring of spinning images. ([http://www.kirupa.com/developer/actionscript/camera\_panning.htm](http://www.kirupa.com/developer/actionscript/camera_panning.htm))

Unfortunately, I’m totally new to actionscript and am having quite a time trying to adjust the code to get it to do what I want it to do, which is:

I’d like to have different individual images spinning around that can trigger an action when clicked.

I can’t even figure out how to get it to load a different image than the one supplied with the tutorial.

Can anyone help me attach some individual clips? (and please remember, I’m new to this so please be gentle if I seem like a total dunce.)

here’s the code i’m working with:

[FONT=“Courier New”]this.createEmptyMovieClip(“theScene”, 1);  
theScene.\_x = 450;  
theScene.\_y = 200;

objectsInScene = new Array();

spin = 0;

focalLength = 600;

displayPane = function(){  
var angle = this.angle - spin;  
var x = Math.cos(angle)\*this.radius;  
var z = Math.sin(angle)\*this.radius;  
var y = this.y;

```
var scaleRatio = focalLength/(focalLength + z);
this._x = x * scaleRatio;
this._y = y * scaleRatio;
this._xscale = this._yscale = 100 * scaleRatio;
this._xscale *= Math.sin(angle);
this.swapDepths(Math.round(-z));

```

}

angleStep = 2\*Math.PI/16;  
for (i=0; i\<16; i++){  
attachedObj = theScene.attachMovie(“pane”, “pane”+i, i);  
attachedObj.angle = angleStep \* i;  
attachedObj.radius = 300;  
attachedObj.x = Math.cos(attachedObj.angle) \* attachedObj.radius;  
attachedObj.z = Math.sin(attachedObj.angle) \* attachedObj.radius;  
attachedObj.y = 40;  
attachedObj.display = displayPane;  
objectsInScene.push(attachedObj);  
}

panCamera = function(){  
spin += this.\_xmouse/1000;

```
	for (var i=0; i&lt;objectsInScene.length; i++){
	objectsInScene*.display();
}

```

};

theScene.onEnterFrame = panCamera;[/FONT]
