6 Replies Latest reply on Apr 28, 2015 11:04 AM by resdesign

    Adding audio to rollover buttons

    matthewdee Level 1

      I'm having a bit of trouble doing this as I see videos to do this using pre Edge 2014 1.1 before the new function panel and then when I look at the 5.0 function panel I cannot get this right.

       

      I'm able to get the sound to work only once then if I rollover after the first time it plays backwards

       

      I just need to have audio play on a mouseover and I have 3 types of files, mp3, ogg and .wav

       

      I do not see any mention of .wav files do I disregard that file?

       

      So far I import ALL THREE OF THESE to the audio folder

       

      once they are in they reside in a symbol with audio notes on it.

       

      I have the mouseover action for the rollover already so I need to go from there.

       

      ADD ACTION GO TO MOUSEOVER AND SELECT AUDIO.

       

      I NEED THE REST, ANYONE?

       

      RD

        • 1. Re: Adding audio to rollover buttons
          resdesign Adobe Community Professional & MVP

          You need to reset your sound to replay

          I would use:

          sym.$("sound")[0].currentTime = 0;

          sym.$("sound")[0].play();

          • 2. Re: Adding audio to rollover buttons
            matthewdee Level 1

            Great, thank you, also wondering about the .wav file so I won't need that correct?

             

            R

            • 3. Re: Adding audio to rollover buttons
              resdesign Adobe Community Professional & MVP

              Well, I personally add the wav files in case but I believe IE does play mp3 as well. I guess you can test for different circumstances like older browsers though animate does not work at all on older IE v8

              • 4. Re: Adding audio to rollover buttons
                matthewdee Level 1

                Thanks for your answer but I need a bit more info.

                I have six rollover buttons each should be assigned a different audio sound.

                 

                Each rollover is a symbol on the main timeline, so when I import the audio for lets say rollover_1 do I open the rollover one symbol and drag the audio on THAT timeline?

                Or do I have to do this on the main timeline?

                 

                In the symbol timeline there is two lables (up and over)

                the audio would need to play on the over state which is why I figure if I need to put the audio on the symbol timeline it would make sense.

                 

                Lets say this is true so on the symbol timeline the over state is exactly at 0.01

                 

                so would I use the following?

                 

                // Play an audio track

                sym.$("rollover_1")[0.01].play();   ???????

                 

                THEN add the code you gave me?

                 

                sym.$("rollover_1")[0].currentTime = 0; ????????

                sym.$("rollover_1")[0].play();             ???


                If I'm inside the symbol timeline where is the current time and play times?


                OR do I place the codes on the maintimeline?



                I hope I'm clear, please advize


                RD

                • 5. Re: Adding audio to rollover buttons
                  resdesign Adobe Community Professional & MVP

                  Hello - you can do what you prefer. I personally write all my code in compositionReady so I do not have to chase stuff around but it is a matter of choice.

                  If you want to write your code in compositionReady then you can add all the sounds on the main stage.

                  Then you can add your code for each button.

                  You can also write your code in the buttons' code window. Use the code snippet so  you get the right scopr.

                  You can also insert the sound in your buttons but frankly I never do.

                  • 6. Re: Adding audio to rollover buttons
                    resdesign Adobe Community Professional & MVP

                    Here is a sample. in 2014.0.1 but the same code will work in 2014.1

                     

                    Button sounds.zip - Box

                     

                    code used below:

                     

                    sym.$('buttonName').bind('mouseenter', function(){

                      sym.$("TaDa")[0].currentTime = 0;

                      sym.$("TaDa")[0].play();

                    });

                     

                     

                    sym.$('buttonName').bind('mouseleave', function(){

                      sym.$("TaDa")[0].pause();

                    });