1 Reply Latest reply on Jun 5, 2014 5:18 PM by jbowden

    I can't target a playing symbol to get it to stop.

    RoryLS1981

      Okay, I'm working on a school project. I basically have a character gallery where when I click on a character thumbnail, it will pull up their picture and information.

       

      I'm trying to set it up so that when I click on a character thumbnail, that character has its own music playing as well.

       

      The problem is, when I click on a second character, I can't get the first character's music to stop playing.

       

      So for the character2 thumbnail, I open up its actions panel and paste this code in:

       

      var mySymbolObject = sym.getSymbol("Character1Music");

      mySymbolObject.stop();

      var mySymbolObject2 = sym.getSymbol("Character2Music");

      mySymbolObject2.play();

       

       

      I do this because I want the music for character1 to stop.

       

      But when I click on the thumbnail for character2, while the music for character2 starts, the music for character1 doesn't stop!

        • 1. Re: I can't target a playing symbol to get it to stop.
          jbowden Adobe Employee

          Hi there,

           

          Stopping a symbol won't stop any audio element in it that's also playing - in that respect, audio elements are similar to  child symbols. Instead, specifically tell the audio element to also stop playing, like so:

           

          var mySymbolObject = sym.getSymbol("Character1Music");

          mySymbolObject.stop(); // this stops the symbol playback

          mySymbolObject.$("your_audio_element").pause(); // this stops the audio element playback. Substitute the name of your audio element

           

          hth,

          Joe

          1 person found this helpful