# The synchronization of two methods problem

**URL:** <https://forum.kirupa.com/t/the-synchronization-of-two-methods-problem/269130>\
**Category:** flash\
**Created:** [August 23, 2008, 5:08am UTC](https://forum.kirupa.com/t/the-synchronization-of-two-methods-problem/269130 "2008-08-23T05:08:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beczesz](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@beczesz](https://forum.kirupa.com/u/beczesz)\
**Post date:** [August 23, 2008, 5:08am UTC](https://forum.kirupa.com/t/the-synchronization-of-two-methods-problem/269130/1 "2008-08-23T05:08:10Z")

</div>

I have a relatively small (I hope) problem…

\*\*public mainFunction()  
{  
this.method1();  
this.method2();  
} \*\*

The question: _how can I synchronize these two method such that, the method2 is being executed only when method1 is finished. And the end of method1 depends on a user event (so it is undefined)?_

I hope somebody can help me…
