# Stop loop or not?

**URL:** https://forum.kirupa.com/t/stop-loop-or-not/191721
**Category:** flash
**Created:** [June 22, 2006, 2:43pm UTC](https://forum.kirupa.com/t/stop-loop-or-not/191721 "2006-06-22T14:43:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Robbe](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/robbe/32/2016_2.png) [@Robbe](https://forum.kirupa.com/u/Robbe)
#### Post date: [June 22, 2006, 2:43pm UTC](https://forum.kirupa.com/t/stop-loop-or-not/191721/1 "2006-06-22T14:43:57Z")

</div>

I’ve got a simple function that works towards a lesson progress bar.

onEnterFrame = function () {  
progTotal = Math.round (\_root.\_totalframes);  
progCurrent = Math.round (\_root.\_currentframe);  
progPercent = (progCurrent/300);  
trace(progPercent);  
}

Works like a champ, but as I traced it I noticed this occurs about 15 times a second (15fps).

This seems like a ton for overhead computing to me, and was wondering if I could just grab it initially on the enterframe and stop. I only need to know once in the frame when it changes (on the entry of a new frame).

Ideas?

Thanks.
