# How To Ask A Variable Its Previous Value?

**URL:** <https://forum.kirupa.com/t/how-to-ask-a-variable-its-previous-value/278885>\
**Category:** flash\
**Created:** [January 7, 2009, 12:29am UTC](https://forum.kirupa.com/t/how-to-ask-a-variable-its-previous-value/278885 "2009-01-07T00:29:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ariel\_mirahy](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@ariel\_mirahy](https://forum.kirupa.com/u/ariel_mirahy)\
**Post date:** [January 7, 2009, 12:29am UTC](https://forum.kirupa.com/t/how-to-ask-a-variable-its-previous-value/278885/1 "2009-01-07T00:29:50Z")

</div>

Hello Kirupians,

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

```auto

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!!!
