# AS3 ProgressBar

**URL:** <https://forum.kirupa.com/t/as3-progressbar/319325>\
**Category:** flash\
**Created:** [February 16, 2011, 11:59am UTC](https://forum.kirupa.com/t/as3-progressbar/319325 "2011-02-16T11:59:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joepiooo](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Joepiooo](https://forum.kirupa.com/u/Joepiooo)\
**Post date:** [February 16, 2011, 11:59am UTC](https://forum.kirupa.com/t/as3-progressbar/319325/1 "2011-02-16T11:59:48Z")

</div>

Hi guys,

I want to make a progressbar. I got a blanc bar and I want to let a red bar grow (from left to right).

I got this code so far:

```auto
var StartDatum:Date = new Date(2011, 01, 16, 12, 38, 15, 0);
var EindDatum:Date = new Date(2011, 01, 16, 12, 59, 15, 0);
var TotaleTijd = EindDatum.getTime() - StartDatum.getTime();

 

var MijnTimer:Timer = new Timer(1000);

MijnTimer.addEventListener(TimerEvent.TIMER, Detijd);
MijnTimer.start();

 

function Detijd(e:TimerEvent=null):void { // add =null to argument

     var Nu:Date = new Date();    
     var TijdOver:Number = Nu.getTime() - StartDatum.getTime();
     var Voortgang:Number = TijdOver / TotaleTijd;
     lijn.scaleX = Voortgang;
     trace (Voortgang);
     trace (TijdOver);
     trace (TotaleTijd);
}
Detijd();

```

There is no error so the code is ok… But I’m missing something I think…

Can somebody help me out?

Tnx
