PDA

View Full Version : Setting styles for a component class


yorkeylady
05-01-2004, 03:44 PM
I'm studying the styles object. It's suppose to change all the components of the type after styles.

But it changes nothing

I have this in the same frame as the component
_global.styles.RadioButton.setStyle ("color", 0xFFFFFF);
_global.styles.CheckBox.setStyle ("color", 0xFFFFFF);

This does work, but why doesn't the code above. I got it from the documentation. _global.styles.RadioButton.setStyle("color", "blue");


var o = _global.styles.RadioButton = new mx.styles.CSSStyleDeclaration();
o.color = 0x0000FF;

Jesse
06-22-2004, 04:22 AM
This bit works for me:
var o = _global.styles.RadioButton=new mx.styles.CSSStyleDeclaration();
o.color = 0x0000FF;
As does this:
_global.styles.RadioButton.setStyle("color", "blue");
But only if you precede it with:
_global.styles.RadioButton = new mx.styles.CSSStyleDeclaration();
That's the right way to go about it.