12 Replies Latest reply on Jun 2, 2009 9:33 PM by kglad

    Scrollbar code to include changing opacity of a graphic

    hatsi59

      Hi All,

       

      I'm not a real actionscipt person as I usually only code simple buttons and the like.

       

      I have a scrollbar that I grabbed off a resources site. (code below)

       

      I want it so that whenever I put the cursor on the scollbar to move it that the graphical information under the scrollbar comes on (either reveal or opacity to 100%). At the moment the little thumbnails under the scrollbar are on all the time and area bit of a distraction (they are meant to assist in the use of the scrollbar by minimising searching behaviour).

       

      Please have a look at the presentation at

      http://www.physclips.unsw.edu.au/waves-sound/oscillations/

      to see what I mean.

       

      Thanks so much to all who reply.

       

      this.createEmptyMovieClip("progFrame",_root.getNextHighestDepth());
      progFrame.onEnterFrame = progStatus;
      progBar.scrubber.onPress = function () {
      progFrame.onEnterFrame = scrubProg;
      this.startDrag(false,0,this._y,500,this._y);
      }
      progBar.scrubber.onRelease = progBar.scrubber.onReleaseOutside = function () {
      progFrame.onEnterFrame = progStatus;
      _root.section1_mc.play();
      this.stopDrag();
      }


      function progStatus() {
      amountPlayed = (_root.section1_mc._currentframe / _root.section1_mc._totalframes);
      progBar.playedBar._width = (Math.round(amountPlayed * 500));
      progBar.scrubber._x = (Math.round(amountPlayed*500));
      }

      function scrubProg () {
      _root.section1_mc.stop();
      _root.section1_mc.gotoAndStop(Math.floor((progBar.scrubber._x/500) * (_root.section1_mc._totalframes)));
      progBar.playedBar._width = progBar.scrubber._x;
      }