# Degrader if issues

**URL:** https://forum.kirupa.com/t/degrader-if-issues/255975
**Category:** Uncategorized
**Created:** [March 28, 2008, 6:40pm UTC](https://forum.kirupa.com/t/degrader-if-issues/255975 "2008-03-28T18:40:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)
#### Post date: [March 28, 2008, 6:40pm UTC](https://forum.kirupa.com/t/degrader-if-issues/255975/1 "2008-03-28T18:40:28Z")

</div>

Hi

I’ve got my carousel spinning, I’ve added a degrader to slow it down if people spin it too fast, which worked

the problem now is I want it to degrade to zero and stop but my speed variable goes from

“0.000010000000000218”

to

“2.1794835359211e-16”

I am at present running two if statements to check regarding which way it is spinning, which is causing it to pin pong rather than reach zero

any input thanks

```auto
 
function mover() {
 //trace("movery");
 myTime = new Date();
 nSeconds = myTime.getSeconds();
 nMinutes = myTime.getMinutes();
 for (var i = 0; i<numOfItems; i++) {
  //_level0.cover.face.news.container.spinner
  _level0.cover.face.news.container.spinner.outside._rotation += 0.01;
  //_level0.cover.face.news.container.spinner.outside._alpha = now.getMonth() *10
  _level0.cover.face.news.container.spinner.inside._rotation += 1+(nMinutes/60);
  _level0.cover.face.news.container.spinner.middle._rotation -= 1+(nSeconds/60);
  var t:MovieClip = home["item"+i];
  //var tw8:Tween = new Tween(t, "_x", Strong.easeOut, 0, Math.cos(t.angle)*radiusX+centerX, 3, true);
  t._x = Math.cos(t.angle)*radiusX+centerX;
  t._y = (Math.sin(t.angle)*radiusY+centerY)-20;
  var s = (t._y-perspective)/(centerY+radiusY-perspective);
  t._xscale = t._yscale=s*100;
  t._alpha = t._alpha=s*100;
  //trace(s)
  //trace(this._alpha);
  t.angle += t._parent.speed;
  t.swapDepths(Math.round(t._yscale)+100);
  //trace(speed);
  // speed degrade so falls back to default speed whichever direction spin
  if (speed>=0.00001) {
   speed = speed-0.00001;
  } else{
   trace("slowdown")
  }
  if (speed<=-0.00001) {
   speed = speed+0.00001;
  }
  else{
   trace("speedup")
  trace("sp" +speed);
  //if (speed ==5.48843468502896e-17 ){ 
  //t.xPos = t._x;
  //t.yPos = t._y;
  //t.theScale = t._xscale;
  //delete t.onEnterFrame
   
  }
 }
}

```
