# Decrease Number exponentially(or at rate) via AS3?

**URL:** <https://forum.kirupa.com/t/decrease-number-exponentially-or-at-rate-via-as3/329760>\
**Category:** flash\
**Created:** [October 12, 2012, 6:30am UTC](https://forum.kirupa.com/t/decrease-number-exponentially-or-at-rate-via-as3/329760 "2012-10-12T06:30:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeekTweak\_0](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@GeekTweak\_0](https://forum.kirupa.com/u/GeekTweak_0)\
**Post date:** [October 12, 2012, 6:30am UTC](https://forum.kirupa.com/t/decrease-number-exponentially-or-at-rate-via-as3/329760/1 "2012-10-12T06:30:39Z")

</div>

I am making (just for the sake of boredom and practice), a ‘generator’ of sorts, where as you drag the mouse along it will create a path of circles behind it along the path. The problem i am having is i want to make the size of the circles decrease in size at an exponential rate(so as the size of the circles decrease, the slower the rate of the decrease). The math is becoming difficult to figure out. Here is my Code:

```auto

import flash.events.TimerEvent;
import flash.display.Sprite;

//Mouse.hide();

var rate:int = 10;

stage.addEventListener(MouseEvent.MOUSE_MOVE, create);

var ballInd:int = 0;
var ballMov:Array = new Array();

var spacing = 0;
var max:int = 15;
var amt:int = 0;

var startSize = 30;

function create(e:MouseEvent)
{
    spacing++;
    if (spacing == 5)
    {
        if (amt < max)
        {
            spacing = 0;
            amt++;
            ballMov[ballInd] = new ball();
            ballMov[ballInd].x = mouseX;
            ballMov[ballInd].y = mouseY;
            ballMov[ballInd].width = **???** ;
            ballMov[ballInd].height = **???** ;
            this.addChild(ballMov[ballInd]);

        }
        ballInd++;
    }
}

```

thanks.
