# Carousel Problem

**URL:** <https://forum.kirupa.com/t/carousel-problem/217040>\
**Category:** flash\
**Created:** [February 22, 2007, 3:05pm UTC](https://forum.kirupa.com/t/carousel-problem/217040 "2007-02-22T15:05:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masonogy1](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Masonogy1](https://forum.kirupa.com/u/Masonogy1)\
**Post date:** [February 22, 2007, 3:05pm UTC](https://forum.kirupa.com/t/carousel-problem/217040/1 "2007-02-22T15:05:35Z")

</div>

Hey guys! I have a script from [[COLOR=#ffff00]www.gotoAndLearn.com[/COLOR]](http://www.gotoandlearn.com/) which creates a navigation menu which acts as a carousel… (Many objects floating around a center object which rotates left or right according to the mouse).

BUT, my problem… I want each of the rotating balls to act as an individual BUTTON, so when I click on it… it falls from the carousel and off the screen… CAN ANYONE HELP ME DO THIS?

## Here is the script I have already:

* * *

Stage.scaleMode = “noScale”;  
stageW = 800;  
function mover()  
{  
this.\_x = Math.cos(this.angle) \* radiusX + centerX;  
this.\_y = Math.sin(this.angle) \* radiusY + centerY;  
var \_loc2 = this.\_y / (centerY + radiusY);  
this.\_xscale = this.\_yscale = \_loc2 \* 100;  
this.angle = this.angle + this.\_parent.speed;  
this.swapDepths(Math.round(this.\_xscale) + 100);  
} // End of the function  
var numOfBalls = 6;  
var radiusX = 250;  
var radiusY = 50;  
var centerX = Stage.width / 2;  
var centerY = Stage.height / 1.9;  
var speed = 5.000000E-003;  
var i = 0;  
while (i \< numOfBalls)  
{  
var t = this.attachMovie(“ball”, “b” + i, i + 1);  
t.angle = i \* (6.283185E+000 / numOfBalls);  
t.onEnterFrame = mover;  
++i;  
} // end while  
this.onMouseMove = function ()  
{  
speed = (this.\_xmouse - centerX) / 7500;  
};

* * *

* * *
