开发者

Override CSS value to be empty in Flex

开发者 https://www.devze.com 2023-01-09 11:08 出处:网络
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 valu

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. 开发者_如何学CI have attempted null and "" with no luck. Any ideas?

Example

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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消