views:

31

answers:

1

I have a Flex 3.2 application for which I am developing a custom style. Basically the first stylesheet gets applied first, and then my custom stylesheet. I am wondering how I can completely empty a value set in the first stylesheet with a value set in the second. The value has to be blank because if the horizontal-center value is set then any other positioning values are ignored. I have attempted null and "" with no luck. Any ideas?

Example

CSS1.css
.myButton {
    horizontal-center: 0;
}

CSS2.css
.myButton {
    horizontal-center: ??
    left: 0;
}
A: 

Perhaps what you need is runtime style selection in ActionScript:

StyleManager.setStyleDeclaration("SelectorName", styleName, true);
StyleManager.clearStyleDeclaration("SelectorName", styleName);

Where styleName is an instance of CSSStyledeclaration, and SelectorName would in your case likely be "Button"

See the page for StyleManager in the liveDocs.

Wade
this may work in other applications, but I am not executing any custom ActionScript code, just custom CSS files.
rosswil