G O A L - Thermometer

Hi I saw this meter 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! :angel:

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)