# I need help with my carousel!

• Beginner
• Posts: 36

3+ Months Ago

I'm needing help with a carousel I'm working on. I'm following Lee Brimelows tutorial. http://www.gotoandlearn.com/player.php?id=32.

var numOfBalls:Number = 5;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.02;

for(var i=0;i<numOfBalls;i++)
{
var t = this.attachMovie("ball","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;
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}

I'd need to change a few things. I'd like the carousel to be static from the start and only move when a button is pressed, either left or right. I would also like the movieclips behind the main to be scaled down and have a lower alpha, and scale up and have a higher alpha when they move to the front.

I would like it to be more ordered; with the main movieclip in the front, with two behind it to the left and right, getting smaller and decreasing in alpha. When a button is pressed it will rotate, but stop as soon as the next moveclip has moved into the center.

Thank you for any help.
• Born
• Posts: 2

3+ Months Ago

i have the answers to you problems

1st... ahh ha ha ha i have exactly the same carousel, from gotoAndLearn.com D

ok static at the start change the var speed:Number = 0.02; to 0 and then add the buttons and use the following:

on(press){
var speed:Number = 1 // and the other -1 to make it go backwards

}

ok scaling the line

this._xscale = this._yscale = s*100;

try messing about with the *100 and it should change the size.

this._alpha = s*100

under

this._xscale = this._yscale = s*100;

and there you have it!

all done

hope it helps

Stupid Saint

## Post Information

• Total Posts in this topic: 2 posts
• Users browsing this forum: No registered users and 9 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum