Ok, I am having some probs with my math here.
I have a carousel and when I click an item I want to bring it to the front and center it. So I have this:
function mover(){
this._x = Math.cos(this.angle) * radiusX + Stage.width/2 - radiusX/4;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = this._y / (centerY + radiusY);
this._xscale = this._yscale = s*100;
this.swapDepths(Math.round(this._xscale + 100));
if(checked == false){
this.angle += speed;
point = 0;
}else{
** if(clp._y > point){ **
for(i=0;i<clpArr.length;i++){
if(clp._x > Stage.width/2 - radiusX/4){
clpArr*.angle += 0.15;
}else{
clpArr*.angle -= 0.15;
}
}
point = clp._y;
}
}
if(this._y < centerY + radiusY/2 + 5){
var blurFilter:BlurFilter = new BlurFilter(centerY - this._y+2,centerY - this._y+2,2);
var myArr:Array = new Array();
myArr.push(blurFilter);
this.filters = myArr;
}else{
this.filters = null;
}
}
The problem is in the bolded part. I just need to know what hte next increment on y is going to be, but I can’t figure it out.
What I want is if (clp._y - nextStepValue > point) … I have tried Math.sin(clp.angle) but it didn’t work…
Any ideas? This would be a great help because if I could figure this out this project would be complete for me.
Thanks