1 Reply Latest reply on Feb 11, 2009 5:39 AM by Newsgroup_User

    menu over slider bar

    yogi bear
      I'm trying to create a menu over a slider bar. The code here show a slider with "button_1" as a movie clip. I have another movie clip on top as a button called "sub_menu". When one rolls over "button_1" the slider moves the _x location and the "sub_menu" art appears. But when one rolls over the "sub_menu" mc the whole thing vibrates because of enter frame. What is the strategy to create a menu over a persistent enter frame piece of art? Any help is appreciated.

      easeSpeed = 5;
      slider_mc.onEnterFrame = function() {
      this._x += (xMove1-this._x)/easeSpeed;


      button_1.onRollOver = function(){
      slider.xMove = button_1._x;
      sub_menu._visible = true;
        • 1. Re: menu over slider bar
          Level 7
          Couple things you could do - one is to use one of the available tweening
          engines to do the animation. You could also add a test to your code to
          remove the enterFrame once the object is within a threshold amount.
          Something like:

          if(Math.abs(this._x - xMove1) < 3){ delete this.onEnterFrame; }

          That'll get it within 3 pixels and then remove the call. If you need it to
          get right to the xMove1 spot, just set this._x = xMove1; within there.

          Dave -
          Adobe Community Expert