# Action script help plz

**URL:** <https://forum.kirupa.com/t/action-script-help-plz/181856>\
**Category:** Uncategorized\
**Created:** [March 13, 2006, 7:14pm UTC](https://forum.kirupa.com/t/action-script-help-plz/181856 "2006-03-13T19:14:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinb18](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@martinb18](https://forum.kirupa.com/u/martinb18)\
**Post date:** [March 13, 2006, 7:14pm UTC](https://forum.kirupa.com/t/action-script-help-plz/181856/1 "2006-03-13T19:14:43Z")

</div>

[COLOR=#003366]Hi, ive been following the 3d wheel turioal and its just what i want ive slighty edited it to suit what i need but i just cant seem to get other movie clips to go onto the wheel im pretty sure its to do with this line ( attachedObj = theScene.attachMovie(“pane2”, “pane2”+i, i);  
) of code but dont quite know how to edit it can any one help plz?[/COLOR]

[COLOR=#003366]// create a scene movieclip to contain all 3D elements  
// and center it on the screen.  
this.createEmptyMovieClip(“theScene”, 1);  
theScene.\_x = 150;  
theScene.\_y = 50;[/COLOR]  
[COLOR=#003366]// now we’r going to create an array to keep track of all the  
// objects in the scene. That way, to position all the objects  
// you just need to loop through this array.  
objectsInScene = new Array();[/COLOR]  
[COLOR=#003366]// no camera, but a rotation will be needed to keep track of the  
// spinning involved (though its the same as the camera)  
spin = 0;[/COLOR]  
[COLOR=#003366]// focal length to determine perspective scaling  
focalLength = 250;[/COLOR]  
[COLOR=#003366]// the function for controling the position of a friend  
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;

this.\_alpha = -z + 130;  
var scaleRatio = focalLength/(focalLength + z);  
this.\_x = x \* scaleRatio;  
this.\_y = y \* scaleRatio;

this.\_xscale = this.\_yscale = 100 \* scaleRatio;  
// on top of the normal scaling, also squish the  
// \_xscale based on where in the rotation the pane is  
// since you would be looking at its side when at a z  
// of 0, it would be at its thinnest which would be  
// 0 since its a completely flat pane. So for that,  
// we can use the trig function of z (sin) to squish the  
// \_xscale based on its position in z.

this.swapDepths(Math.round(-z));  
}[/COLOR]  
[COLOR=#003366]  
// attach each pane in a loop and arrange them in a  
// circle based on the circumference of the circle  
// divided into steps  
angleStep = 2\*Math.PI/8;  
for (i=0; i\<8; i++){

attachedObj = theScene.attachMovie(“pane2”, “pane2”+i, i);  
attachedObj.angle = angleStep \* i;  
attachedObj.radius = 80;  
attachedObj.x = Math.cos(attachedObj.angle) \* attachedObj.radius;  
attachedObj.z = Math.sin(attachedObj.angle) \* attachedObj.radius;  
attachedObj.y = 100;  
attachedObj.display = displayPane;  
objectsInScene.push(attachedObj);  
}

Many thanks Martin[/COLOR]
