ScrollPane: setStyle for both scrollbars

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.


// 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