A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Scroll Bars?

  1. #1
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Scroll Bars?

    Any manage to make a custom scroll bar for a text area? I've tried using a tutorial from a book and have come close. I've gotten hung up on the dragging of the slider. The default scroll bar is just terrible and doesn't even look to the end user like what they expect a scroll bar to look like.

    Brant surely there is a way to pull the code from you scroll pane to make a nice scrollbar component for KM
    Last edited by blanius; 08-29-2005 at 09:09 PM.

  2. #2
    Senior Member FLASHPULSE's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    1,356

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    As for creating new components, don't expect any new components based on the current code. Since we have a symbol library know, if I'll create other components they will be based on that functionality and will look different.

    But you can use the scrollbar from the scrollpane component.
    If your textfield is named txt1, try this
    Code:
    myStyle = new KStyleFormat();
    myStyle.background = 0xF0E0C0;
    myStyle.face = 0x50F090;
    myStyle.scrollBar = 0x80C0FF;
    myStyle.gradient=false;
    myStyle.shaded=true;
    myStyle.liquid=true;
    
    CreateKScrollBar("scroller1",1,txt1);
    scroller1.setStyle(myStyle);
    Make sure you check the box in the export settings to include components. If you already have something at depth 1, change the second parameter of CreateKScrollBar.
    Last edited by w.brants; 08-30-2005 at 12:16 AM.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Version 5.1 should/might have a new dynamic text object with scroll bar based on Flash 8 functionality. Wilbert will be developing it. Wilbert, if you want, post the nice scroll bar example you sent me.

  5. #5
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by Bob Hartzell
    Wilbert, if you want, post the nice scroll bar example you sent me.
    Okay, attached is a little gif file how the scroller (most likely) will look like.

    Since it's no secret anymore now Bob mentioned it I might as well share some information on what I want to accomplish so users can give feedback if they feel I'm missing something.

    My goal is to create a flash 8 based general content component for displaying text, swf movies or images.
    I'm planning to implement the following content types :
    - (html)text (read-only); both direct assignment and external files
    - movies ; both swf files and movies in the symbol library
    - (progressive) jpeg files
    - (transparent) gif files
    - (transparent) png files

    I'll try to keep the code small meaning I won't implement all features the current components have and add some others. You will be able to set colors as you want but won't be able to change the style of a component already on stage and you won't be able to use liquid style anymore.

    You will be able to auto hide one of the two scrollers (asked for multiple times for the current scrollpane component).

    You will be able to select a cross-fade or pixel dissolve transition when you assign new content.

    All this of course if I succeed in implementing it. For now most of it only exists inside my mind.
    Attached Images Attached Images
    Last edited by w.brants; 08-30-2005 at 07:40 AM.

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Looks great Brants, the code for the old komponents worked fine with one exception. The scroll bar is not updated when the text changes. How can I fource it to update?

  7. #7
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Do you mean if you use the textfield for input or when you reassign text ?

    The scroller is supposed to monitor changes in the textfield and update itself.

  8. #8
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    Did I hear right? No liquid style???
    Gotta check if I use it or need it.
    I might not need it. Though, I like to use "curves" in my designs.

  9. #9
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Quote Originally Posted by w.brants
    Do you mean if you use the textfield for input or when you reassign text ?

    The scroller is supposed to monitor changes in the textfield and update itself.
    It's when I load dynamic text it doesn't update.

  10. #10
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Bret,
    Does it help to force an update after setting the text ?
    Code:
    myScroller.kRefresh();
    Docree,
    You heard it right. There's two important reasons for that decision. The first and most important one the amount of code it takes to implement. The second one a change in personal design preference; to me the liquid style is beginning to feel a bit outdated by now.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Hmm it seems to be an related to the fact that this is in a loaded movie.

    Update was happening when run stand alone, but not when loaded into my root movie.

    check out equipment button:
    http://prconsultantsvideoandfilmllc.com/

    then alone
    http://prconsultantsvideoandfilmllc.com/equipment.swf
    Last edited by blanius; 08-31-2005 at 07:45 AM.

  12. #12
    Senior Member pherbrick's Avatar
    Join Date
    Jul 2004
    Location
    Los Angeles
    Posts
    291
    Wilbert, Archive the liquid style code where you can find it. If lava lamps could make a comeback....

  13. #13
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by pherbrick
    Wilbert, Archive the liquid style code where you can find it. If lava lamps could make a comeback....
    Don't worry Peter, I will. Besides that, Bob also has the source code.

    Bret, to be honest I haven't got a solution to your problem. It may have to do with the interval function the scroller uses to monitor the textfield. Does it make any difference if you disable the interval function of your main movie (just to test) ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center