1 Reply Latest reply on Jan 18, 2010 8:43 AM by Ned Murphy

    Call a functions within a function ?

    Synxmax

      Hi

       

      Is there anyway to call my functions within a function ?

       

      function musicPlayer() {

           trace("Music");

           function pauseMusic(){

                trace("Pause");

           }

      }

       

      if i call musicPlayer function i will get Music in output now how can i call pauseMusic from outside of parent function !?

      is this possible ?

       

      thanks in advance

        • 1. Re: Call a functions within a function ?
          Ned Murphy Adobe Community Professional & MVP

          You can call functions within other functions, but you don't want define functions inside other functions... they will only have scope within the function if they work at all.

           

          function pauseMusic(){

               trace("Pause");

          }

           

          function musicPlayer() {

               trace("Music");

               pauseMusic();

          }

           

          musicPlayer();