# Function after a global function executes?

**URL:** <https://forum.kirupa.com/t/function-after-a-global-function-executes/175897>\
**Category:** Uncategorized\
**Created:** [January 18, 2006, 5:54pm UTC](https://forum.kirupa.com/t/function-after-a-global-function-executes/175897 "2006-01-18T17:54:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesO](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@JamesO](https://forum.kirupa.com/u/JamesO)\
**Post date:** [January 18, 2006, 5:54pm UTC](https://forum.kirupa.com/t/function-after-a-global-function-executes/175897/1 "2006-01-18T17:54:19Z")

</div>

Hey all

I have a menu opening from the side, and that function is called openMenu; and it’s \_global. When that menu opens, I think it’d be nice to have the open windows slide over with it. My idea so far is to have a function inside each window that goes something like,

```auto
x = (this._x + 160) // 160 is the menu width.
y = this._y

when openMenu() executes = function() {
     this.slideTo(x, y, seconds, animType);
}

```

And then the inverse when closeMenu executes.

How can flash tell when openMenu executes?
