I have followed Lee’s tutorial and got results quite well but need to move the carousel as per teh mouse. At the moment I have modified this.angle -= this._parent.speed; where I made + to - to move it towards the mouse but this changes direction only once I cross the center. I want it to move even if I do not cross the middle ie if I am to the extreme right of the screen if I move the mouse towards the left, the carousel should move in the same direction even if it does not cross the middle. Please help. Code below.
Thanks
var numOfBalls:Number = 6;
var radiusX:Number = 610;
var radiusY:Number = 200;
var centerX:Number = Stage.width/2;
var centerY:Number = 960/2;
var speed:Number = 0.05
var home:MovieClip = this;
for(var i=1;i<=numOfBalls;i++)
{
var t = home.attachMovie("item"+i,"b"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfBalls);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);
this._xscale = this._yscale = s*100;
this.angle -= this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/10000;
}