1 Reply Latest reply on Dec 24, 2006 10:45 AM by kglad

    problem with a script making the number of lives change

    god0fgod
      http://www.zshare.net/download/super...flash-fla.html - The fla file (As my code is all over the place you probably might want to look at this)

      The lives doesn't work. I made a movie clip with different frames and on each frame there are different numbers of hearts on.The code on the frame mario dies is:

      Code:
      onEnterFrame = function () {
      if (_root.healtha._currentframe != 1) {
      _root.healtha.gotoAndPlay(_root.healtha._currentframe-1);
      }
      if (_root.healtha._currentframe == 1) {
      _root.healtha.gotoAndPlay(_root.healtha._currentframe+3);
      }
      if (_root.healtha._currentframe == 3) {
      _root.gotoAndPlay("scene2", 1);
      } else {
      _root.gotoAndPlay(2);
      }
      };
      The movie clip containing the hearts should be at _root.healtha So i want when mario dies the number of hearts goes down and when the number of hearts is zero and he dies (when _root.healtha is on frame 3) you go to scene2.

      Thats the code for the fla file i uploaded the new code is:

      onEnterFrame = function () {
      if (_root.healtha._currentframe == 1) {
      var aa:Number = _root.healtha._currentframe+3;
      _root.healtha.gotoAndStop(aa);
      } else if (_root.healtha._currentframe != 2) {
      var bb:Number = _root.healtha._currentframe-1;
      _root.healtha.gotoAndStop(bb);
      } else if (_root.healtha._currentframe == 2) {
      _root.gotoAndPlay("scene2", 1);
      }
      _root.gotoAndPlay(2);
      };