1 Reply Latest reply on Sep 27, 2010 11:44 AM by ommvc61

    Picking up wrong sound

    ommvc61 Level 1

      Thank you "kglad" for all your help, hopefully we can trouble shoot one AS issue.

       

      You have helped me with attaching a sound to a movie using AS, in this case, it is a car tire that screeches when rolled over. I added a "tailpipe" idle sound when we roll over the tailpipe of the car. I have attached linking to the sound file named, "idle", and copied the "screech" AS code and edited, but now all the screeching tires have picked up the idle sound. All the movie mechanics work fine.

       

      Here's the AS Code:

      (T1 & T2 are the tires, tailpipe is the idle movie)

       

      T1.stop();


      T1.onRollOver = over;

      T1.onRollOut = out;


      function over() {

      this.gotoAndPlay(2);

      screech.start();

      }


      function out() {

      this.gotoAndStop(1);

      screech.stop();

      }


      var screech:Sound=new Sound(this);

      screech.attachSound("tire_screech");

      screech.onSoundComplete=function(){

      this.start();

      }


      T2.stop();


      T2.onRollOver = over;

      T2.onRollOut = out;


      function over() {

      this.gotoAndPlay(2);

      screech.start();

      }


      function out() {

      this.gotoAndStop(1);

      screech.stop();

      }


      var screech:Sound=new Sound(this);

      screech.attachSound("tire_screech");

      screech.onSoundComplete=function(){

      this.start();

      }


      tailpipe.stop();


      tailpipe.onRollOver = over;

      tailpipe.onRollOut = out;


      function over() {

      this.gotoAndPlay(1);

      idle.start();

      }


      function out() {

      this.gotoAndStop(1);

      idle.stop();

      }


      var idle:Sound=new Sound(this);

      idle.attachSound("idle");

      idle.onSoundComplete=function(){

      this.start();

      }