PDA

View Full Version : [AS3] ScrollPane backgroundColor?


msomers
06-29-2009, 09:08 PM
I have been trying to set the background color of the scrollpane
component in CS4 with no avail. Here are some of things I've tried and
the problems.

1. SP.setStyle("backgroundColor",0xFF0000)
Problem: doesn't seem to work in AS3 and CS4

2. _global.styles.ScrollPane.setStyle("backgroundColor", 0XFF0000);
Problem: doesn't seem to work in AS3 and CS4

3.SP.opaqueBackground = 0xFF0000
Problem: area around bottom edge and outside of scroll content is
solid red the rest is sort of a muted or semitransparent red.
alpha = 0 makes all the content movie clips transparent.

4. Create movie clip holder and set dimensions after all other sub
movie clips have been added to get max width and height & set color to red.
Problem: Works best, but there's a white border at bottom of scrollpane.

Any thoughts or solutions to this dilemna are appreciated.
TFTH.

Matt

mimamim
09-02-2009, 10:15 PM
Hi,
I hope you've already solved this by now. Just for people, who are looking for an answer as well as I did today:

This will remove background (shadowed box) completely:

var newSkinClip:MovieClip = new MovieClip();
SP.setStyle( "skin", newSkinClip ); //ScrollPane_upSkin
SP.setStyle( "upSkin", newSkinClip );


This will set the background to red:


var newSkinClip:MovieClip = new MovieClip();
newSkinClip.graphics.clear();
newSkinClip.graphics.beginFill(uint(0xff0000), 1);
newSkinClip.graphics.drawRect(0,0,272.0, 191.0);
newSkinClip.graphics.endFill();

SP.setStyle( “skin”, newSkinClip ); //ScrollPane_upSkin
SP.setStyle( “upSkin”, newSkinClip );