3 Replies Latest reply on Apr 7, 2010 1:10 PM by msakrejda

    Duplicate variable definition.

    SpaghettiCoder Level 3

      Am I doing this wrong,

       

      if

      {

      var myEvent

      dispatchEvent(myEvent)

      }

      else

      {

      var myEvent

      dispatchEvent(myEvent)

      }

       

      I get duplicate variable definition warnings...

       

      the variable is internal to the function

      it's in a if/else so it's shouldn't be mixing itself up.

       

      Should I be renaming the internal temp variable to myEvent1, myEvent2..then dispatching it...like that in the if/else

       

      or creating another function and calling the dispatch function from there?