# ASK: Animation by Script (AS2)

**URL:** <https://forum.kirupa.com/t/ask-animation-by-script-as2/322462>\
**Category:** flash\
**Created:** [May 22, 2011, 6:14am UTC](https://forum.kirupa.com/t/ask-animation-by-script-as2/322462 "2011-05-22T06:14:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sangjagoan](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@sangjagoan](https://forum.kirupa.com/u/sangjagoan)\
**Post date:** [May 22, 2011, 6:14am UTC](https://forum.kirupa.com/t/ask-animation-by-script-as2/322462/1 "2011-05-22T06:14:52Z")

</div>

I’m using Flash CS4 as2. I have 2 movieclips, i want to animate them by some script as follow.  
//==bof===  
function tweenFlow1() {  
easeType = mx.transitions.easing.None.easeNone;  
var begin = 100;  
var end = 200;  
var time = 1;  
var mc = Flow1;  
Execution = new mx.transitions.Tween(mc, “\_x”, easeType, begin, end, time, true);  
}  
function tweenFlow2() {  
easeType = mx.transitions.easing.None.easeNone;  
var begin = 300;  
var end = 400;  
var time = 2;  
var mc = Flow2;  
Execution = new mx.transitions.Tween(mc, “\_y”, easeType, begin, end, time, true);  
}  
myBtn.onRelease = function() {  
tweenFlow1();  
if(Flow1.\_x==200)  
{  
tweenFlow2();}  
};

//==eof===  
The target script above is to animate mc “Flow2” after mc “Flow1” done, but i don’t know why in that script the mc “Flow2” is not running. Anything mistake on that script ??? Or any other advice ??? Please help !!!
