Hi again, i update my scrollbar AS3 Class, named scrollbase, and today i post it for download, it’s really ease to work and so smaller than past version, only 1.5 kb.

The Features:
• Small file size
• Ease effect (or not) when move content
• Click the scroll background to move
•  Full customizable
• Scroll dragger with dynamic size
• All in one line

Download the Scrollbase sample and independent class (1487)

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

To use it you can write only two lines, so easy. The first line is the import and the second line is the scrollbase constructor, you need only put inside the constructor basicaly four movieclips, like show the sequence: content movieclip, mask of the content movieclip, the dragger movieclip and last movieclip is the background of the dragger, where the dragger will slide. Show the sample code bellow:

import com.dLibs.utils.scrollbase;
var sb:scrollbase = new scrollbase(conteudo,mascara,dragger,background,5,30);

This code show that ‘conteudo’ is the content movieclip and will be mask for ‘mascara’. ‘dragger’ is the movieclip that you click and move to see the rest of the content and move this movieclip upper of  ’background’ movieclip. So easy, but there we have some more arguments.

The fiveth argument is the Ease speed, you can change for more or less ease effect, by default the ease uint is 1 (one). The sixth argument is the bottom padding, you can put a number in pixels to show after the content movieclip, so much good for full background scrollbar, by default this padding is 0 (zero).

When you need you can verify if the scrollbase is necessary using the public function verifyHeight(). You can change the content of the moviclip and verify if content movieclip have the height propertie bigger than your mask. Usage:

import com.dLibs.utils.scrollbase;
var sb:scrollbase = new scrollbase(conteudo,mascara,dragger,background,5,30);
sb.verifyHeight();

You can download and change if you need. Try it!

Download the Scrollbase sample and independent class (1487)

Creative Commons License
Scrollbase by Scrollbar for AS3 is licensed under a Creative Commons Attribution 3.0 United States License.
Based on a work at code.google.com.

26 July ‘09 /EDIT —————————–

I’m working in a new version of scrollbase and as soon as possible i will post here the classe code and samples, now im working with a temp class named scrollbasic that i made to resolve the problem that @sonia said in comment. You can download the scrollbasic with link bellow and as so simple to use like scrollbase:

import com.dLibs.utils.scrollbasic;
var nsc:scrollbasic = new scrollbasic(DataRecord.getDocumentClass, conteudo, mascara, sdragger, sbground);

Need set the main document class, you can create one static class to set and get it, and set the movieclips as content clip, mask clip, dragger clip and scrollbar background. Probabily i will post the new version of scrollbase 31 July ‘09.

Thanks for all and sorry for the error.
: )

Download: Scrollbasic - Temporary Scrollbar Class (352)

Related Posts

24 Responses to “AS3 Scrollbar: Scrollbase Class [Updated]”

  1. Ramon Fritsch Says:

    Ok man, great job!

    I have made a scroll class too. Verify in http://blog.ramonfritsch.com/t/scroll

    cheers

  2. » Simple AS3 Scrollbar | DES 84 - Blog of DES84 Website Says:

    [...] March 3rd, 2009 UPDATE: Scrollbar AS3: Scrollbase Class [Updated] [...]

  3. Ramon Fritsch Says:

    Opá, tudo certo?

    Que bom que gostou.. coloquei teu rss no meu reader ;)
    o que acha de trocarmos links?

    grande abraço

  4. Avertedd Says:

    Очень полезная вещь, спасибо!!

  5. Pablo Davi Says:

    @Ramon Fritsch: pode entrar em contato pelo p[at]novesfora[dot]com[dot]br

  6. Ramon Fritsch Says:

    Dale!

    Te mandei e-mail lá.. abração!

  7. Dimmka Says:

    Мне кажется очень полезная штука

  8. David Says:

    Olá, em primeiro lugar obrigado pela classe!

    Entretanto tenho andado a tentar usar isto no meu projecto mas existem coisas que não funcionam por provavelmente estar a importar o swf com a scrool para um parent.

    o Erro que aparece é o seguinte:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at dLibs.utils::scrollbase()
    at vivamelhor_fla::MainTimeline/frame1()

    Penso que tem a ver com os EventListener para as funcoes releaseDrag e moveContentWheel, visto que nenhuma delas funciona.

    Tentei usar “parent” mas nao deu…

    Obrigado!

  9. Pablo Davi Says:

    David, testei o scroll importando para outro SWF file e funciona normal, vou fazer outros testes e posto alguma novidade aqui. Breve.

  10. David Says:

    Obrigado Pablo,

    Eu no swf principal tenho este codigo:

    function vivaMelhor(event:MouseEvent):void{

    var vm:swfContainer=new swfContainer(756,1359,”vivamelhor.swf”,”loader.swf”);
    removeChild(objecto);
    addChild(vm);
    vm.x = 317;
    vm.y = 348;
    objecto=vm;
    }

    A funcção acima basicamente é uma classe que chama um swf e coloca na MainTimeline.

    Depois tenho o código que está neste vivamelhor.swf

    var sb:scrollbase = new scrollbase(texto_mc,mascara,dragger,background,5);

    Que funciona perfeitamente quando o exporto sozinho, mas quando o chamo pelo swf principal, da-me o erro que te indiquei.

    Obrigado mais uma vez

  11. Pablo Davi Says:

    @David: Acredito que encontrei o problema do scroll, estou fazendo alguns testes hoje e amanha e logo farei uma atualização e deixarei aqui o aviso. Obrigado.

  12. Pablo Erick Cardoso Says:

    Seu trabalho é excepcional , vamos trocar umas idéias um dia desses, mesmo nome, programando as3 e morando em Goiânia… que estranho, não pode ser coincidência.

  13. Pablo Davi Says:

    @Pablo Erick Cardoso, obrigado pelo excepcional mesmo eu nao acreditando tanto nisso eheheh. Vamos trocar ideia sim é essa a ideia basica de eu ter criado o blog e todos os meios de redes sociais ate hoje ehehe. Sou Pablo também e ainda de Goiânia assim como voce. Qualquer coisa me add no Twitter: @pablodavi ou se preferir me adicione no MSN: p@novesfora.com.br

  14. diogolean Says:

    muito bom..
    cara, postei uma classe para scroll tb..
    se quizer dar uma olhada:
    http://www.blog.diogolean.com/

  15. sonia Says:

    hello,

    i use this scrollbar class;

    it works very well under windows but against the scrollbar does not work on Mac (wheel mouse).

    Do you know why?

    Thanl you !!!

  16. Pablo Davi Says:

    @sonia im working on other version of scrollbase and will be mac wheel fixed. Sorry.

  17. sonia Says:

    @pablo Ok, thank you!

    But just out of curiosity, why does this not work on Mac?

  18. Ramon Fritsch Says:

    @sonia the wheel feature need to be simulated by javascript to work on mac. See: http://hasseg.org/blog/?p=138

    cheers

  19. sonia Says:

    Hello,

    When I delete a clip that contains the scrollbar, I have always this error:

    TypeError: Error # 1009: It is impossible to access the property or method of a null object reference.
    At com.dLibs.utils: scrollbase /:: releaseDrag ()

    how to remove the scrollbar when deleting a clip so that we no longer have this error?
    Thank you:)

  20. Pablo Davi Says:

    Hi @sonia. i updated the post with a temporary scrollbar class and i promisse that i will post the new version with no bugs 31 July. Sorry for all and thanks for your comments and feedback
    : )

  21. sonia Says:

    Okay thank you !!!

  22. Free international call >> Why waste money on international calls when ... Says:

    ..]one useful source of information on this subjectis ,blog.des84.com,..]

  23. Sharedtut Says:

    You did a good job at explaining this one, thank you for sharing.

  24. xmas gift ideas Says:

    This is my second visit to your blog. We are starting a brand new initiative in the same niche as this blog. Your blog provided us with valuable information to work on. You have done a marvellous job.

Leave a Reply