In my loop I have a number that is constantly changing – I need to figure out how to tell if the number is increasing or decreasing:
Some pseudo code that doesnt work 🙂
var now:Number;
var then:Number;
function loop():void
{
now = changingNumber;
then = changingNumber;
if (now > then) {
// increasing
}else {
// decreasing
}
}
Alternatively, you can prepare a getter and setter for your value and manage an increase or decrease there.
This method will be more efficient and not require a loop.