How To Pad Scrollpanes


I loaded some dynamic content into a scrollpane, and eventually got it to scroll. But it was pushed right against the edges of my scrollpane and looked ugly.

I was determined to find out how to pad the scrollpane, so I started editing various parts of the scrollpane FUI…and I got it! :pleased: :stuck_out_tongue:

Here’s what ya have to do …
[]Open up the Scrollpane MC in the library
]Click on frame 1 of the actions layer and open the actions panel
[]Underneath “// ::: FScrollPaneClass” add “customPaddingVar = 20 ;”
]Scroll to lines 78+79 and use:

this.offset.x = -customPaddingVar;
this.offset.y = -customPaddingVar;

[*]Scroll to lines 114+115 and change the lines to:

this.contentWidth = this.content_mc._width+(2*customPaddingVar);
this.contentHeight = this.content_mc._height+(2*customPaddingVar);

[*]Go back to your main movie and watch your nice newly padded scrollpane
[/list]:smiley: Just change the variable at the top of the class and your whole padding changes. Ingenious. I’m really proud of myself now :stuck_out_tongue:

Thought I’d post as I’ve seen other ppl ask the question on various forums and no one has been able to reply :slight_smile:

Let me know if this is any use to anyone
Luke =]