# Calculating progress bar size

**URL:** <https://forum.kirupa.com/t/calculating-progress-bar-size/318193>\
**Category:** flash\
**Created:** [January 12, 2011, 7:36pm UTC](https://forum.kirupa.com/t/calculating-progress-bar-size/318193 "2011-01-12T19:36:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outback](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@outback](https://forum.kirupa.com/u/outback)\
**Post date:** [January 12, 2011, 7:36pm UTC](https://forum.kirupa.com/t/calculating-progress-bar-size/318193/1 "2011-01-12T19:36:59Z")

</div>

Hi guys,

I’m having some problems trying to calculate the size of a progress bar.

Here is the thing I have a movie with X scenes and I want the progress bar to fill up according to the porcentage of my timeline that has passed.

here is the code I’m using

```auto

var parcialSeek
var completeSeek

this.addEventListener(Event.ENTER_FRAME, tamanhoBarra)
function tamanhoBarra(e:Event):void{
    completeSeek = vid_mc.totalFrames // vid_mc is the movie clip that loads my external SWF
    parcialSeek = vid_mc.currentFrame / vid_mc.totalFrames
    seek_mc.seekBar_mc.scaleX = parcialSeek
}

```

with this code every new scene the bar starts again and since I don’t have exacts 100 frames on my movie the bar size dosen’t match?

can anyone please help? thanks a lot for the atention!!
