# Listen for a variable change?

**URL:** <https://forum.kirupa.com/t/listen-for-a-variable-change/176986>\
**Category:** Uncategorized\
**Created:** [January 28, 2006, 9:18pm UTC](https://forum.kirupa.com/t/listen-for-a-variable-change/176986 "2006-01-28T21:18:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanel96](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tanel96](https://forum.kirupa.com/u/tanel96)\
**Post date:** [January 28, 2006, 9:18pm UTC](https://forum.kirupa.com/t/listen-for-a-variable-change/176986/1 "2006-01-28T21:18:37Z")

</div>

i’m trying to determine whether the value of a certain variable has changed…

basically the code is something like this:

```auto

this.onEnterFrame = function() {
 if (loaded != filesize) {
  _root.preloader._visible = true;
  _root.preloader.preloader_text.text = Math.round(loaded/filesize*100);
 } else if (loaded=filesize) {
  _root.laius = _root.picture._width;
  _root.korgus = _root.picture._height;
  _root.preloader._visible = false;
 }
}

```

i need to figure out how to determine when values of \_root.laius and \_root.korgus change…

any ideas ?
