1 Reply Latest reply on Feb 3, 2008 9:14 AM by Jamesabth

    Action script (if/else) HELP

    aa.sonatine
      hello

      I have this code in my time line

      [quote]:

      var som:Sound;
      som = new Sound();
      som.loadSound("musica.mp3");

      som.start(0,9999);
      som.setVolume(20);

      _root.btsom_mc.onRelease = function(){
      var identifica:Number = 0;
      if(identifica == 0){
      som.stop();
      identifica = 1;
      }else{
      som.start(0, 9999);
      identifica = 0;
      }
      }
      [/quote]


      when i click the button it loads the sound above the one is playing.. it does not see that the sound is allready playing..

      can someone help me???

      thanks
        • 1. Re: Action script (if/else) HELP
          Jamesabth Level 1
          Hi again!

          1. var identifica:Number = 0; has to be outside function

          2. check that you have spelled identifica correctly everywhere in your version of the code as this is the only possible thing that would make the exact results you are having happen.

          3. Try this code - instead of a number, booleans are more effective: