# ScrollPane: setStyle for both scrollbars

**URL:** <https://forum.kirupa.com/t/scrollpane-setstyle-for-both-scrollbars/306857>\
**Category:** flash\
**Created:** [March 23, 2010, 2:43pm UTC](https://forum.kirupa.com/t/scrollpane-setstyle-for-both-scrollbars/306857 "2010-03-23T14:43:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JumpingJokes](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@JumpingJokes](https://forum.kirupa.com/u/JumpingJokes)\
**Post date:** [March 23, 2010, 2:43pm UTC](https://forum.kirupa.com/t/scrollpane-setstyle-for-both-scrollbars/306857/1 "2010-03-23T14:43:42Z")

</div>

Hello to everybody

I nearly managed to skin the scrollbars of the ScrollPane component however …

The following script replaces a button of the scrollbar with a movieclip. That’s fine. But it only works with one scrollbar (horizontal) whereas the same button of the other scrollbar mysteriously disappears.

```auto

// this script needs the ScrollPane component in your library

import flash.display.MovieClip;
import flash.text.TextField;
import fl.containers.ScrollPane;
import fl.controls.ScrollBar;

//----- create visual elements -------
// red skin clip 
var newSkinClip:MovieClip = new MovieClip();
newSkinClip.graphics.beginFill(uint(0xff0000), 1);
newSkinClip.graphics.drawRect(0,0,22, 22);
newSkinClip.graphics.endFill();

// text
var newText:TextField = new TextField();
addChild (newText);
newText.width = 300;
newText.autoSize = "left"
newText.wordWrap = true;

// fill textField with random text
for (var i:int=0; i<44; i++)
{
    newText.appendText (Math.random()*99999999+ " ")
}
// -------------------------------

// ------- init scrollPane -------
var myScrollPane:ScrollPane = new ScrollPane();
myScrollPane.move (44, 44);
myScrollPane.source = newText;
myScrollPane.setSize (newText.width-15, 200);
addChild (myScrollPane);
// --------------------------------

// ------- try skinning -------
myScrollPane.setStyle("upArrowUpSkin", newSkinClip);

// the skin works appears on the horizontal scrollbar

// This sounds promising - but it does not work: 
// myScrollPane.horizontalScrollBar.setStyle("upArrowUpSkin", newSkinClip)

```

Has one of you ever solved this problem? Ideas are very welcome.

Henry
