# Start Tween After Another - MouseEvent.CLICK

**URL:** <https://forum.kirupa.com/t/start-tween-after-another-mouseevent-click/332590>\
**Category:** flash\
**Created:** [August 6, 2014, 2:18pm UTC](https://forum.kirupa.com/t/start-tween-after-another-mouseevent-click/332590 "2014-08-06T14:18:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atoyansk](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@atoyansk](https://forum.kirupa.com/u/atoyansk)\
**Post date:** [August 6, 2014, 2:18pm UTC](https://forum.kirupa.com/t/start-tween-after-another-mouseevent-click/332590/1 "2014-08-06T14:18:05Z")

</div>

Hi all,

I have 2 buttons and 2 objects on my stage. And I inserted a global variable, to control the animation order between these objects. Follows the code:

```auto

var lvl:int;
lvl = 0;

var myBack1 = new Tween(mc1, 'y', Regular.easeIn,317,164, 1, true);
	myBack1.stop();
var myBack2 = new Tween(mc2, 'y', Regular.easeIn,317, 164, 1, true);
	myBack2.stop();
var myTween1 = new Tween(mc1, 'y', Regular.easeIn, 164, 317, 1, true);
	myTween1.stop();
var myTween2 = new Tween(mc2, 'y', Regular.easeIn, 164, 317, 1, true);
	myTween2.stop();	

	
btn1.addEventListener(MouseEvent.CLICK, onClick1);
	
	function onClick1(e:MouseEvent):void {
		if(lvl == 0){
			myTween1.start();
			lvl = 1;
		}
		if(lvl == 2){
			myBack2.start();
			myTween1.start();
			lvl = 1;
		}
	}
	
btn2.addEventListener(MouseEvent.CLICK, onClick2);
	
	function onClick2(e:MouseEvent):void {
		if(lvl == 0){
			myTween2.start();
			lvl = 2;
		}
		if(lvl == 1){
			myBack1.start();
			myTween2.start();
			lvl = 2;
		}
	}

```

The animation is working perfectly. However, I need that the animation “myTween” wait for the completion of the animation “myBack” to be ran after, whenever appropriate.  
How can I do it?

Thanks!
