1 Reply Latest reply on Aug 6, 2009 7:50 PM by tonyromo

    onRollOver sound in a movie clip object


      Scenario: I have a  frame with a quiz question and three answer options. The three answer options are movie clips. Their instance names are q1_soundA, q1_soundB, and q1_soundC. I want each option to make a different sound when rolling over them. My sounds are already in the library and they have been linked: each one has a unique identifier (a, b, and c) and "Export for ActionScript" and "Export in first frame" are checked. Under frame properties, sound is none, sync is event, and repeat is 1.


      I have a separate layer with the following code in the first frame (the quiz question is in the second frame):


      var snd_a = new Sound();

      var snd_b = new Sound();

      var snd_c = new Sound();

      gotoAndStop("q1"); // Go to the first question

      // Sounds to be played as options in each question
      q1_soundA.onRollOver = function () { snd_a.start(0,1); }
      q1_soundB.onRollOver = function () { snd_b.start(0,1); }
      q1_soundC.onRollOver = function () { snd_c.start(0,1); }

      q1_soundA.onRollOut = function () { snd_a.stop(); }
      q1_soundB.onRollOut = function () { snd_b.stop(); }
      q1_soundC.onRollOut = function () { snd_c.stop(); }


      Note: I also have three transparent buttons underneath each movie clip. I am using these buttons and some code to record the answers and calculate a score. This part is working fine though.

      Problem: As soon as the quiz question frame is displayed, the first sound is played over and over again even if the cursor is not even close to any of the option answers. It doesn't matter where I move or click, the sound keeps playing all the time. I am new to ActionScript, so I'm not sure if I'm missing something somewhere. There is no code in any other frame or object.


      Thanks in advance for your help.