How To Ask A Variable Its Previous Value?

Hello Kirupians,

I’m trying to get a variable’s previous data value, for example:


var delay = 8

this.myButtonChange_btn.onPress = function () {
delay = 5;
}

this.myButtonTrace_btn.onPress = function () {
trace ("delay previous data"+delay.previousData); 
//previousData doesn't exist is an example
}

I have my variable delay set to 8, then I press a button that changes delay’s value to 5.

Then, I have a button that would tell me delay’s previous value, that it would be 8, because its actual value is 5.

Is there an instruction that does that?

THANKS!!!