PDA

View Full Version : How do I change scrollpane styles ?


motofzr1000
08-29-2004, 02:04 PM
Hi,

I just started using Flash MX 2004 Professional (7.2), and I want to use the Scrollpane component. I succeeded in adding the content, and removing the border, and changing the color of the arrow when clicking it.

However... I want to change some additional things, such as removing the scrollTrackColor, but whatever I do, nothing changes... I've searched on different forums, and tried, but it doesn't change anything...

This is the code I'm using now:

scrollpane.setStyle("themeColor", "0x3F4860");
scrollpane.setStyle("borderStyle", "none");
scrollpane.setStyle("scrollTrack","none");
scrollpane.setStyle("arrow","0x800080");
scrollpane.setStyle("background","0xFFFFFF");
scrollpane.setStyle("backgroundDisabled","0xFFFFFF");
scrollpane.setStyle("foregroundDisabled","0xFFFFFF");
scrollpane.setStyle("face","0x000000");
scrollpane.setStyle("highlight3D","0xFFFFFF");
scrollpane.setStyle("highlight","0xFFFFFF");
scrollpane.setStyle("shadow","0xFFFFFF");
scrollpane.setStyle("darkshadow","0xFFFFFF");
scrollpane.setStyle("focusRectInner","0xFFFFFF");
scrollpane.setStyle("focusRectOuter","0xFFFFFF");
scrollpane.drawFocus = false

I've also included a zipped file of the FLA which contains the Scrollpane...

Does anyone know what I'm doing wrong here ?

Thanks in advance,

Jurgen

tdoublea
09-25-2004, 03:25 AM
motofzr1000,

you're on the right track.
a string of a color value doesn't set the color though.
try just 0xFFFFFF instead of "0xFFFFFF"

another thing is that i'm not sure where you got all the names for the style properties, but some of them might be wrong or might not even exist.

"background" for instance is really "backgroundColor";

if you want to dig deep into colors and changing the appearance of anything in a MX2004 component, enter #initclip into the help files and select
"Applying new skins", navigate to the StandardComponents.fla in the config/first_run (windows/mac) folder, and have some fun
this shows you how to register your stylized skins within an fla, but has the disadvantage of applying to all instance of that component (so if you wanted two different looking scrollpanes, this wouldn't help).

hope that helps. i feel your pain, i've pulled out a lot of hair when it comes to MX2004 components... that's why i've started making my own.

-t

campbela
09-27-2004, 10:43 AM
I had this problem too. Because the default is "Halo" theme, you first have to import & apply another theme (try file>import>open external library> browse to macromedia...flashmx2004...firstRun>componentFLA > SampleTheme.fla
For some reason, you can't use the same level of customisation with "Halo"
Sorry I can't be more precise, but there are some good tutorials around on this (try Ultrashock Tutorials).

Once applied, you can then use simple actionscript to change track color. eg.

csp.setStyle("scrollTrackColor","0x999999");

regards, Alex