2 Replies Latest reply on Jan 10, 2007 7:28 PM by Jason93

    instance name problems

    peachstone
      Can anyone tell me why this works on 4 out of 5 of my menu buttons?
      I had the problem with one more till i renamed the instances.
      Also, how would i put all this code into one place and not in the button.

      on (rollOver) {
      if (_root.link<>11) {
      this.gotoAndPlay("s1");
      }
      }
      on (releaseOutside, rollOut) {
      if (_root.link<>11) {
      this.gotoAndPlay("s2");
      }
      }
      on (release) {
      if (_root.link<>11) {
      _root["Menu"+_root.link].gotoAndPlay("s2");
      _root.link = 11;
      _root.gotoAndPlay("s4");
      _root.scroller.scroller.gotoAndStop(3);
        • 1. Re: instance name problems
          abeall Level 3
          > Can anyone tell me why this works on 4 out of 5 of my menu buttons?
          What doesn't work?

          > Also, how would i put all this code into one place and not in the button.
          myButton.onRollOver = function(){
          if(_root.link!=11){
          this.gotoAndPlay("s1");
          }
          }
          etc
          • 2. Re: instance name problems
            Jason93
            You need to explain what the things are. What is s1? Where is it?
            If you want code all in one place, click on the frame where the button is (or make a new layer called actionscript which is what I do) and put in
            BUTTONINSTANCENAME.onRollOver = function () {
            if (_root.link<>11) {
            BUTTONINSTANCENAME.gotoAndPlay("s1");
            }
            }
            etc. Just obviously replace BUTTONINSTANCENAME with the name of it.