# Carousel: Align objects with different height

**URL:** <https://forum.kirupa.com/t/carousel-align-objects-with-different-height/252142>\
**Category:** flash\
**Created:** [February 16, 2008, 6:22pm UTC](https://forum.kirupa.com/t/carousel-align-objects-with-different-height/252142 "2008-02-16T18:22:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boyboy2006](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@boyboy2006](https://forum.kirupa.com/u/boyboy2006)\
**Post date:** [February 16, 2008, 6:22pm UTC](https://forum.kirupa.com/t/carousel-align-objects-with-different-height/252142/1 "2008-02-16T18:22:44Z")

</div>

Dear all,  
I face a problem when aligning objects with different height in a Carousel animation. Each object is an image that loaded from xml file. The result is here:  
[http://chucuoifx.com/help/carousel.html](http://chucuoifx.com/help/carousel.html)

You see, the object with high height will overlap my reflection. I try to set the registration point but it’s not working. Could you help me to align all the objects by bottom edge.

Thank you.

My source file is stored here:  
[http://chucuoifx.com/help/help.rar](http://chucuoifx.com/help/help.rar)

My actionscript:

import mx.utils.Delegate;  
var numOfItems:Number;  
var radiusX:Number = 190;  
var radiusY:Number = 30;  
var centerX:Number = Stage.width/2 - 5;  
var centerY:Number = Stage.height/2 + 15;  
var speed:Number = 0;[//0.0001](https://0.0001);  
var perspective:Number = 10;  
var home:MovieClip = this;  
var tooltip:MovieClip = this.attachMovie(“tooltip”, “tooltip”, 10000);  
tooltip.\_visible = false;  
var xml:XML = new XML();  
xml.ignoreWhite = true;  
xml.onLoad = function() {  
var nodes = this.firstChild.childNodes;  
numOfItems = nodes.length;  
for (var i = 0; i\<numOfItems; i++) {  
var t = home.attachMovie(“item”, “item”+i, i+1);  
t.angle = i\*((Math.PI_2)/numOfItems);  
t.onEnterFrame = mover;  
t.toolText = nodes_.attributes.Title;  
t.toolText2 = nodes\*.attributes.Author;  
t.toolText3 = nodes\*.attributes.Price;  
t.Link = nodes\*.attributes.Link;  
t.icon.inner.loadMovie(nodes\*.attributes.image);  
t.r.inner.loadMovie(nodes\*.attributes.image);  
t.icon.onPress = clickImage;  
t.icon.onRollOver = over;  
t.icon.onRollOut = out;  
t.icon.onRelease = released;  
}  
};  
function clickImage()  
{  
home.onPress = getURL(this.\_parent.Link,"\_self");  
}  
function over() {  
home.tooltip.tipText.autoSize = true;  
home.tooltip.tipText.text = this.\_parent.toolText;  
home.tooltip.onEnterFrame = Delegate.create(this, moveTip);  
home.tooltip.\_visible = true;  
}  
function out() {  
delete home.tooltip.onEnterFrame;  
home.tooltip.\_visible = false;  
}  
function released() {  
trace(this.\_parent.toolText);  
delete home.tooltip.onEnterFrame;  
home.tooltip.\_visible = false;  
}  
function moveTip() {  
home.tooltip.\_x = this.\_parent.\_x;  
home.tooltip.\_y = this.\_parent.\_y-this.\_parent.\_height/2;  
if(home.tooltip.\_x \< 138) {  
home.tooltip.\_x = 138;  
}  
if(home.tooltip.\_x \> 362) {  
home.tooltip.\_x = 362;  
}  
if(home.tooltip.\_y \< 48) {  
home.tooltip.\_y = 48;  
}  
}  
xml.load(“books.xml”);

function mover() {  
this.\_x = Math.cos(this.angle)_radiusX+centerX;  
this.\_y = Math.sin(this.angle)radiusY+centerY;  
var s = (this.\_y-perspective)/(centerY+radiusY-perspective);  
this.\_xscale = this.\_yscale=s100;  
this.angle += this.\_parent.speed;  
this.swapDepths(Math.round(this.\_xscale)+100);  
}  
function updateSpeed()  
{  
speed = 0.01;  
}  
speedInterval = setInterval(updateSpeed,1000);  
var interval:Number = 18;  
var startTime:Number = getTimer();  
var bStart:Boolean = false;  
this.onEnterFrame = function() {  
var currentTime:Number = getTimer();  
if (currentTime\>=startTime+(interval_1000)) {  
delete this.onEnterFrame;  
clearInterval(speedInterval);  
deCreaseSpeed();  
if (speed\<=0) {  
speed = 0;  
}  
delete currentTime;  
bStart = true;  
}  
};  
function deCreaseSpeed() {  
speed -= 0.01;  
if (speed\<=0) {  
speed = 0;  
}  
}  
backward.onPress = function()  
{  
speed += 0.05;  
}  
backward.onRelease = function()  
{  
speed = 0;  
}  
forward.onPress = function()  
{  
speed -= 0.05;  
if(speed == 0.1) {  
speed -= 0.3;  
}  
}  
forward.onRelease = function()  
{  
speed = 0;  
}
