Simple ScrollBar

I would like to share my simple scroll bar AS2 component which you can use in your old projects download SimpleScrollBar.zip (17.81 KB)

12 Responses

  1. John Says:

    great !

  2. ronald Says:

    thanks! big help..

  3. rex Says:

    hi,

    how about horizontal scrollbar? how to implement with this component.

    thanks

  4. Antonos Says:

    very simple:
    var scroll_c = ref.attachMovie(”ScrollBar”,”scroll_mc”,1,{_x:ref.mask_mc._x,_y:ref.mask_mc._y + ref.mask_mc._height});
    scroll_c.setHeight(ref.mask_mc._height);

    scroll_c.PageSize = ref.mask_mc._width;
    scroll_c.McHeight = ref.content_mc._width+40;
    scroll_c.Chunks = ref.content_mc._width+40-ref.mask_mc._width;

    scroll_c._rotation = -90;
    scroll_c._parent.onScroll = function()
    {
    ref.content_mc._x = ref.mask_mc._x - this.scroll_mc.getScrollPos();
    }

    scroll_c.init();

    scroll_c.onPress = function(){}

  5. Federico Says:

    I found a bug, when you have more than 1 frame, the scroll bar appears on every frame after. Is there a way to not have this happen?

    Thanks

  6. Federico Says:

    Nevermind…I used:
    removeMovieClip(”scroll_mc”);

  7. max Says:

    Hello and thank you for this script. I’ve spent a lot of time messing with scrollers but I always get tired of how they look, or find they look tired.

    Your script is great, however I have multiple frames inside the content_mc, each frame has a dynamic text field which has a different height.

    I am looking for a way to re-size the content_mc from each frame inside. I have made little progress, as I have only managed to stretch the content.

    Thank you for reading this and I would really appreciate any pointers you might have

    Thanks
    Max

  8. Jun Says:

    how about adding some easing when dragging the scroller? how to implement thid functionality?…

    Thanks,

  9. Angela Says:

    What I have to do, if I want to repeat the same scroll in te same swf, but different content, what I have to change, I have benn trying that for weeks,
    Please help, tks!!

  10. Laura Says:

    Hi, could you let me know how can I make the scrolling go “faster” when the arrows are clicked, I find it’s too slow and I’m really no expert in code. I’d appreciate your help, thanks!!

  11. Antonos Says:

    hi guys,
    sorry for delay, was busy last weeks

    Jun, for example you can use TweenLite for that
    http://www.greensock.com/tweenlite/

    code to implement:

    import com.greensock.*;
    //…….
    scroll_c._parent.onScroll = function()
    {
    TweenLite.to(ref.content_mc, 1, {_y:ref.mask_mc._y - this.scroll_mc.getScrollPos()});
    }

    Angela, to put one more instance of scrollbar to stage you will have to add mask for each content and put different names, e.g. mask1_mc, mask2_mc etc.
    than when you attach scroll set different names for each scroll
    var scroll1_c = ref.attachMovie(”ScrollBar”,”scroll1_mc”,1,{_x:ref.mask1_mc._x+ref.mask1_mc._width-10,_y:ref.mask1_mc._y});
    than onScroll event change position of corresponding content holders
    scroll1_c._parent.onScroll = function(){ ref.content1_mc._y = ref.mask1_mc._y - this.scroll1_mc.getScrollPos();
    }

    Laura, you can make scrolling faster by increasing you frame rate (in this case scrolling will be smoother and faster but it will affect CPU) or you can play with PageSize,McHeight and Chunks parameters (but it will make scrolling coarser)

  12. Antonos Says:

    Max, you have to change McHeight and Chunks parameters for each content you are scrolling

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.