3 Replies Latest reply on Feb 6, 2010 1:54 PM by slow_starter

    Urgent help for Flash scrollbar gallery needed

      I'm creating a scrollbar gallery from a tutorial from this site.


      Though I've completed the tutorial, and customised the gallery to my own needs, however I'm trying to make a very small change to it - and no matter what I do, keep running into problems.


      I'm trying to replace the rectangular handle with my own customised handle - a (20 x 20) 'circular' png image that I've imported into Flash, made a graphic and stored in the library (though I understand it can be imported using actionscript, like the other images in the gallery).


      Here's the original code from the tutorial:
      function scroller () {
      _root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_ mc", _root.myGallery_mc.getNextHighestDepth());
      _root.scroller_mc._y = _root.bar_y;


      _root.scroller_mc.lineTo(_root.scroller_width,_roo t.bar_thickness);


      And here's my own modified version of the code:
      function scroller() {
      _root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_ mc", _root.myGallery_mc.getNextHighestDepth());
      _root.scroller_mc._y = _root.bar_y+1;




      _root.scroller_mc.onPress = function() {
      startDrag(this, false, 0, this._y, _root.scrollbar_mc._width-this._width+21, this._y);
      moverInterval = setInterval(mover,250);


      _root.scroller_mc.onRelease = _root.scroller_mc.onReleaseOutside=function () {
      As you will see, the furthest I've got is to 'draw' a circle for the scroller using drawing API - but I'd much rather use my own customised version instead.


      If anyone can please show me how such a (otherwise straightforward) operation can be achieved it will be much appreciated.



        • 1. Re: Urgent help for Flash scrollbar gallery needed
          kglad Adobe Community Professional & MVP

          you're not drawing a circle with any of that code.


          but, if you want to use a library asset instead of the drawing api to give visible content to _root.scroller_mc, create a library movieclip with your graphic, export it for actionscript, assign it a linkage id and use attachMovie() instead of createEmptyMovieClip().

          1 person found this helpful
          • 2. Re: Urgent help for Flash scrollbar gallery needed
            Ned Murphy Adobe Community Professional & MVP

            If you are trying to use the png you have in the library, then the only way to do it aside from manually placing it in the stage is to load it using code.  But I don't see anything in the way of your attempting to do that.  If you convert your png into a movieclip that you keep in the library and assign that a linkage ID, you can use attachMovie to place it wherever it is supposed to be going.  If the first set of code you show is supposed to be the handle getting added, then it would probably change to something like...


            function scroller () {
                 _root.scroller_mc = _root.myGallery_mc.createEmptyMovieClip("scroller_ mc", _root.myGallery_mc.getNextHighestDepth());
                 _root.scroller_mc.attachMovie("png_mc_ID", "handle", scroller_mc.getNextHighestDepth() );


            • 3. Re: Urgent help for Flash scrollbar gallery needed
              slow_starter Level 1

              SOLVED! Thanks for the answer.