# Need to simulate a listener for a variable

**URL:** https://forum.kirupa.com/t/need-to-simulate-a-listener-for-a-variable/102709
**Category:** Uncategorized
**Created:** [February 26, 2004, 8:23am UTC](https://forum.kirupa.com/t/need-to-simulate-a-listener-for-a-variable/102709 "2004-02-26T08:23:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Thief\_of\_Light](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@Thief\_of\_Light](https://forum.kirupa.com/u/Thief_of_Light)
#### Post date: [February 26, 2004, 8:23am UTC](https://forum.kirupa.com/t/need-to-simulate-a-listener-for-a-variable/102709/1 "2004-02-26T08:23:47Z")

</div>

I have a Javascript setInterval that checks to see if the window.location of a certain frame has changed. If so, I tell it to send the value of the window.location into Flash through a variable.

My problem lies in getting Flash to see this change without using an onEnterFrame event. I do not want Flash to loop continuously to check if the value of the variable has changed if I do not have to. Is there any way I can trigger a function that detects change in value of the variable? Is there a way I can add a listener or onChanged (which is only for textfields) to a variable?

If not in Flash, is there a way for Javascript in one frame to tell when a different frame loads a different location without using setInterval? Is there possibly a listener that could be developed to listen to another frame’s information? If anyone has any light on this situation, please help! Trying to figure this out is driving me nuts! :h:
