# G O A L - Thermometer

**URL:** <https://forum.kirupa.com/t/g-o-a-l-thermometer/260711>\
**Category:** flash\
**Created:** [May 19, 2008, 7:06am UTC](https://forum.kirupa.com/t/g-o-a-l-thermometer/260711 "2008-05-19T07:06:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![artavenir](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/artavenir/32/3400_2.png) [@artavenir](https://forum.kirupa.com/u/artavenir)\
**Post date:** [May 19, 2008, 7:06am UTC](https://forum.kirupa.com/t/g-o-a-l-thermometer/260711/1 "2008-05-19T07:06:50Z")

</div>

Hi I saw this meter [http://www.pi.pwp.blueyonder.co.uk/goal-thermometer.html](http://www.pi.pwp.blueyonder.co.uk/goal-thermometer.html) at an older thread and I was able to animate it.

Only thing is it won’t work if I changed the values to let say 80.5% (only works with 80% as an example) or even with 4 digits. The animation of the bar seems to loop and not stop.

Here is the code for the movie clip thermometer\_mc:

onClipEvent(enterFrame)  
{  
if (\_root.thermvalue \<= 100)  
{  
this.bar.play();  
if (this.bar.\_currentframe == \_root.thermvalue)  
{  
this.bar.stop();  
}

```
}

```

}

Any HELP would be appreciated! 👼

---

<div class="post-metadata">

**Author:** ![dataxa](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dataxa](https://forum.kirupa.com/u/dataxa)\
**Post date:** [May 19, 2008, 9:01am UTC](https://forum.kirupa.com/t/g-o-a-l-thermometer/260711/2 "2008-05-19T09:01:55Z")

</div>

As u can see on this line:  
if (this.bar.\_currentframe == \_root.thermvalue)  
this.bar.\_currentframe is Integer (without digits) and if you set \_root.thermvalue with digits, they cant ever be equal so animation wont stop.

If u want it to work, use \>= instead of == OR use Math.floor(\_root.thermvalue)
