6 Replies Latest reply on Jul 3, 2013 8:11 PM by brsastre

    How do i call a Function from another Function ?

    brsastre Level 1

      When i press a button, i want a series of functions to execute one after another (they contain tweens, but its irrelevant), each of them waiting for the previous to be completed. I want to put the series of functions inside one function, so i can call just this function to execute all the others. The animations are working fine, but i dont know how call Functions from within another function. Also it would be necessary each function to wait until the previous has completed, to execute. Here is a clear example of what i need to do:

       

      boton.onPress = animate ;

       

      Function animate () {

       

           animation1 (onComplete: animation2);

           animation2 (onComplete: animation3);

           animation3 ;

       

      }

       

      Function animation1 () { Tween 1};

      Function animation2 () { Tween 2};

      Function animation3 () { Tween 3};

       

       

      any suggestions ?