2 Replies Latest reply on Mar 9, 2007 1:06 PM by kglad

    button paths

    laphlegm
      I have some buttons within my site that I am trying to apply rollover actions to. they work fine when I create them alone in a seperate project, but then do not work when I put them into my site. I know they are because my path names aren't correct and possible some confusion with instnace names. I have created movieclips with an invisible button over them. The button has the following code:

      on (rollOver) {
      this.mouse_over_mainPage = true;
      }
      on (rollOut) {
      this.mouse_over_mainPage = fstartlse;
      }
      on (release){
      getURL(" http://www.shootingheadcowboys.com/main.php");
      }

      The movie clip has the instance name 'mainPage' and the actionscript has the code:

      this.mainPage.onEnterFrame = function() {
      if (mouse_over_HomePage) {
      this.mainPage.nextFrame();
      } else {
      this.mainPage.prevFrame();
      }
      };

      my site is set up where this button lies within a movie clip called site_mc within the main scence. I haven't defined any variables yet or anything else because I am not sure what to do. Any help would be awesome! hope all is well.
        • 1. Re: button paths
          laphlegm Level 1
          Ah! seemed to have figured it out, taking out 'this' seemed to work, and there was also HomePage where mainPage should have been. Does anyone know why taking out 'this' makes it work?
          • 2. Re: button paths
            kglad Adobe Community Professional & MVP
            the "this" in your onEnterFrame handler refers to mainPage. so when you use this.mainPage.nextFrame(), flash thinks you have a child movieclip of mainPage (with instance name mainPage) whose timeline it's trying to advance.