7 Replies Latest reply on Sep 5, 2007 5:57 AM by Greg Dove

    if/ else stamement not working???

    D3 Level 1
      Can someone help me with this...

      I have a movie clip called cPlay_mc that I want to perform two sections of code depending on a condition. When I put the if/ else statement in the script it doesn't work. I'm basically trying to tell the play button to continue playing the main movie if the user hit the pause button and/ or have the play button start from the beginning of the main movie if the main movie ran and stopped at the end of the clip. Here' s the code:

      var v_name = true;
      _global.replay = v_name;

      this.cPlay_mc.onRelease = function(){
      if (replay = true){
      trace(replay);
      this.enabled = false;
      this.gotoAndStop("on");
      this._parent.Play();
      this._parent.cPause_mc.enabled = true;
      this._parent.cPause_mc.gotoAndStop("off");
      this._parent.cStop_mc.enabled = true;
      this._parent.cStop_mc.gotoAndStop("off");
      }
      else (replay = false){
      this._parent.pTarget.gotoAndPlay(2);
      slider._x = pSliderX;
      this.cPlay_mc.gotoAndPlay("on");
      this.cPlay_mc.enabled = false;
      this.cStop_mc.enabled = true;
      this.cStop_mc.gotoAndStop("off");
      this.cPause_mc.enabled = true;
      this.cPause_mc.gotoAndStop("off");
      this.pPlaying = true;
      }
      }

      // Pause button.

      this.cPause_mc.onRollOver = function(){
      this.gotoAndStop("over");
      }

      this.cPause_mc.onRollOut = function(){
      this.gotoAndStop("off");
      }

      this.cPause_mc.onRelease = function(){
      this.gotoAndStop("on");
      this.enabled = false;
      this._parent.Stop();
      this._parent.cStop_mc.enabled = false;
      this._parent.cStop_mc.gotoAndStop("off");
      this._parent.cPlay_mc.enabled = true;
      this._parent.cPlay_mc.gotoAndStop("off");
      replay = false;