A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Force whitespace on ScrollPane?

  1. #1
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180

    Force whitespace on ScrollPane?

    Hi there,

    I was wondering if it's possible to force the ScrollPane to show a white border around it's content?

    I'm using the folowing 'hack' to edit it's content on the flow:
    code:
    this.createClassObject(mx.containers.ScrollPane, "sp", 1);
    sp.contentPath = "empty";
    var content = sp.content;


    This allows me (when you have both the ScrollPane and en empty MC with linkage 'empty' in your library) to edit it's content with the variable 'content'. This is something very usefull, but it introduces the folowing problem:

    When I place something on x:0, y:0 a part of it get's displayed behind the edges of the scrollpane. The same thing happesn when you scroll to the right, things get displayed behind the scrollbar.

    Is there an easy way to fix this, or do I have to cheat a little?

    ~Sph

  2. #2
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Just a small update:
    I've worked around the problem a bit, by removing the scrollbars and make the user scroll by dragging the area. But now I still loose some 2 or 3 pixels on every side, because of the edges of the area.

    ~Sph

  3. #3
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    If I got you right, you could just set the style for the SP.

    f8 help:
    ScrollPane component > Customizing the ScrollPane component > Using styles with the ScrollPane component

    so you should be able to just set the border to "none".

    nGFX

  4. #4
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Ah sweet:
    code:
    sp.setStyle("borderStyle", "none");


    Did the trick

    Now I won't have to write a tile scrolling engine for my editor But can place my tiles straight into the ScrollPane, saves me some work

    Thanks
    Last edited by SaphuA; 07-24-2006 at 10:45 AM.

  5. #5
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Keep in mind that if you have a lot of tiles, it might slow down a bit when you use the ScrollPane instead of a tile scrolling engine. But for an editor, I wouldn't worry too much about it, it should work fine.

  6. #6
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Exactly

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