I'm creating a thermometer with the mercury animated as donations come in. I haven't touched flash in a long time, so be gentle.
How can I change the code below so the animation is faster without increasing the framerate?
var maxMercuryHeight = 192; // Mercury height at 100%
var currentDonations = 80; // Percentage of donations taken
var currentHeight = (currentDonations / 100) * maxMercuryHeight;
mercury.onEnterFrame = function()
{
if(mercury._height < currentHeight) {
mercury._height++;
} else {
delete mercury.onEnterFrame;
}
}
trace(currentHeight);
Bonus question: How can I make the animation ease out so it starts fast and slows down at the end?
Thanks!