I need help with my carousel!

  • Jack Sparrow
  • Beginner
  • Beginner
  • Jack Sparrow
  • Posts: 36

Post 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 radiusX:Number = 250;
var radiusY: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;
var s = this._y /(centerY+radiusY);
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.
  • StupidSaint
  • Born
  • Born
  • StupidSaint
  • Posts: 2

Post 3+ Months Ago

i have the answers to you problems

1st... ahh ha ha ha i have exactly the same carousel, from gotoAndLearn.com :-DD

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

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.

and finally the alphaing add

this._alpha = s*100


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 7 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

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.